Index: Doc/Extra/dbfactorysupport.html ================================================================== --- Doc/Extra/dbfactorysupport.html +++ Doc/Extra/dbfactorysupport.html @@ -83,11 +83,11 @@ <DbProviderFactories> <remove invariant="System.Data.SQLite"/> <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, - Version=1.0.81.0, Culture=neutral, + Version=1.0.78.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/> </DbProviderFactories> </system.data> </configuration> Index: Doc/Extra/designer.html ================================================================== --- Doc/Extra/designer.html +++ Doc/Extra/designer.html @@ -48,22 +48,22 @@ SQLite databases from within Visual Studio is a great time-saver.  Though the support is not yet fully-implemented, there's certainly enough there to keep you busy.  You can create databases, design and execute queries, create typed datasets and lots more all from Visual Studio.

Installation Instructions

-

Download and run one of the setup packages and then select the "Install - the designer components for Visual Studio 20XX." option when prompted.

+

+ In Windows Explorer, navigate to SQLite.Net\bin\Designer + and execute the INSTALL.EXE program.  It will automatically + detect what eligible Visual Studio products are installed, and allow you to check + and uncheck which environments to install the designer for.

Express Edition Limitations

-

Visual Studio design-time Support, works with all versions of Visual Studio - 2005/2008/2010. You can add a SQLite database to the Servers list, design - queries with the Query Designer, drag-and-drop tables onto a Typed DataSet, etc. -
- - Due to Visual Studio licensing restrictions, the Express Editions can no - longer be supported. - -

+

All Express Editions (except Visual Web Developer) are hard-coded to only allow you to design for Jet and Sql Server Database Files.  The only way for SQLite + to install its designer is to temporarily replace one of the existing "approved" + designers.  Therefore, when you install the SQLite designer for one of these + express editions, it will temporarily replace the Microsoft Access designer.  + You can revert back to the Access designer simply by re-running the install.exe + program and un-checking the boxes.


Version History

-

1.0.81.0 - June XX, 2012

- -

1.0.80.0 - April 1, 2012

- -

1.0.79.0 - January 28, 2012

- -

1.0.78.0 - January 27, 2012

+

1.0.78.0 - January XX, 2012

About SQLite.NET

-

This class library is an ADO.NET wrapper around the popular (and free!) - SQLite database engine. For information on SQL syntax, features of SQLite and a - good understanding of how it works and what it does, I highly recommend heading - over to sqlite.org and +

This class library is an ADO.NET wrapper around the popular (and free!) + SQLite database engine. For information on SQL syntax, features of SQLite and a + good understanding of how it works and what it does, I highly recommend heading + over to sqlite.org and reading the documentation there.

-

The C# provider, the very minor C code modifications to SQLite, documentation and - etc were written by Robert +

The C# provider, the very minor C code modifications to SQLite, documentation and + etc were written by Robert Simpson, and the SourceForge project page can be found here.

-

The System.Data.SQLite project is currently maintained by the - SQLite Development Team and - the latest source code and project information can be found - here.


What's New?

-

Click here to see the version history of this SQLite.NET +

Click here to see the version history of this SQLite.NET provider


Using this library

-

The following are links to information on various aspects of the library and +

The following are links to information on various aspects of the library and how to use it in your application(s)

How to install Visual Studio Design-Time Support

-

How to configure and enumerate SQLite.NET +

How to configure and enumerate SQLite.NET through the DbProviderFactories object

Getting the best performance out of SQLite

-

Limitations of the SQLite.NET provider and the SQLite +

Limitations of the SQLite.NET provider and the SQLite engine (compared to other providers and engines)


SQLite.NET Provider Features

-

This SQLite provider implements every feature of the underlying SQLite +

This SQLite provider implements every feature of the underlying SQLite database engine without omission. Here's a brief summary:

  • - Written from scratch on Visual Studio 2008 specifically for ADO.NET, implenting all the + Written from scratch on VS2005/2008 specifically for ADO.NET, implenting all the base classes and features recently introduced in the framework, including automatic transaction enlistment.
  • Supports the Full and Compact .NET Framework, as well as native C/C++ development.  100% binary compatible with the original sqlite3.dll.
  • -
  • Full support for Mono via a "managed only" provider that runs against the +
  • Full support for Mono via a "managed only" provider that runs against the official SQLite 3.6.1 or higher library.
  • Full Entity Framework support (ADO.NET 3.5 SP1)
  • On the Compact Framework, it is faster than Sql Server Mobile. SQLite's installed size is a fraction of Sql Mobile's. It uses less memory at runtime, runs queries faster, and has a smaller database file size as well.
  • Encrypted database support.  Encrypted databases are fully encrypted and support both binary and cleartext password types.
  • -
  • Visual Studio 2005/2008/2010 Design-Time Support.  You can add a SQLite - database to the Servers list, design queries with the Query Designer, +
  • Visual Studio 2005/2008 Design-Time Support.  You can add a SQLite + database to the Servers list, design queries with the Query Designer, drag-and-drop tables onto a Typed DataSet, etc.
  • -
  • Full SQLite schema editing inside Visual Studio.  You can create/edit +
  • Full SQLite schema editing inside Visual Studio.  You can create/edit tables, views, triggers, indexes, check constraints and foreign keys.
  • - Available as a single file redistributable (except Compact Framework).  The core sqlite3 codebase and the ADO.NET wrapper + Single file redistributable (except Compact Framework).  The core sqlite3 codebase and the ADO.NET wrapper are combined into one multi-module assembly.
  • -
  • Also available as separate native and managed assemblies and optionally with the Visual C++ Runtime statically linked.
  • -
  • - Binaries included for Itanium, x64, x86 and ARM processors. -
    - - Itanium processor support not currently included. - -
  • +
  • Binaries included for Itanium, x64, x86 and ARM processors.
  • DbProviderFactory support.
  • Full support for ATTACH'ed databases.  Exposed as Catalogs - in the schema.  When cloning a connection, all attached databases are + in the schema.  When cloning a connection, all attached databases are automatically re-attached to the new connection.
  • DbConnection.GetSchema(...) support includes the MetaDataCollections, DataSourceInformation, Columns, Tables, Views, ViewColumns, - Catalogs, Indexes, + Catalogs, Indexes, IndexColumns, ForeignKeys and Triggers.
  • - Enhanced DbDataReader.GetSchemaTable() functionality returns catalog, namespace + Enhanced DbDataReader.GetSchemaTable() functionality returns catalog, namespace and detailed schema information even for complex queries.
  • Named and unnamed parameters.
  • - Full UTF-8 and UTF-16 support, each with optimized pipelines into the native + Full UTF-8 and UTF-16 support, each with optimized pipelines into the native database core.
  • Multiple simultaneous DataReaders (one DataReader per Command however).
  • - Full support for user-defined scalar and aggregate functions, encapsulated into - an easy-to-use base class in which only a couple of overrides are necessary to + Full support for user-defined scalar and aggregate functions, encapsulated into + an easy-to-use base class in which only a couple of overrides are necessary to implement new SQL functions.
  • - Full support for user-defined collating sequences, every bit as simple to + Full support for user-defined collating sequences, every bit as simple to implement as user-defined functions and uses the same base class.
  • - Full source for the entire engine and wrapper.  No copyrights.  + Full source for the entire engine and wrapper.  No copyrights.  Public Domain.  100% free for commercial and non-commercial use. 

Distributing the Binaries (Desktop)

-

When using the mixed-mode assembly, the System.Data.SQLite.DLL file - includes all the native and managed code. In that case, this is the only - DLL required to be redistributed with your SQLite.NET application(s).  - When using separate native and managed assemblies, the - System.Data.SQLite.DLL file contains all the managed code and the - SQLite.Interop.DLL file contains all the native code. - The native code comes in 3 flavors: Win32, Itanium and x64 (AMD64). -
- - Itanium processor support not currently included. - -

+

System.Data.SQLite.DLL is a mixed assembly signed with a strong name + in case you want to add it to the Global Assembly Cache (GAC). This is the only DLL required to be redistributed with + your SQLite.NET application(s).  It + comes in 3 + flavors: Win32, Itanium and x64 (AMD64).

Distributing the Binaries (Compact Framework)

-

Both the System.Data.SQLite.DLL and SQLite.Interop.XXX.DLL files - must be deployed on the Compact Framework.  The XXX is the build number of - the System.Data.SQLite library (e.g. "081").  The - SQLite.Interop.XXX.DLL file is a fully native assembly compiled for - the ARM processor, and System.Data.SQLite is the fully-managed Compact - Framework assembly.

+

System.Data.SQLite.DLL and SQLite.Interop.XXX.DLL must be + deployed on the Compact Framework.  The XXX is the build number of the + System.Data.SQLite library (e.g. "078").  SQLite.Interop.XXX is a fully + native assembly compiled for the ARM processor, and System.Data.SQLite is the + fully-managed Compact Framework assembly.


Index: Doc/SQLite.NET.chm ================================================================== --- Doc/SQLite.NET.chm +++ Doc/SQLite.NET.chm cannot compute difference between binary files Index: Externals/Eagle/bin/Eagle.dll ================================================================== --- Externals/Eagle/bin/Eagle.dll +++ Externals/Eagle/bin/Eagle.dll cannot compute difference between binary files Index: Externals/Eagle/bin/EagleShell.exe ================================================================== --- Externals/Eagle/bin/EagleShell.exe +++ Externals/Eagle/bin/EagleShell.exe cannot compute difference between binary files Index: Externals/Eagle/bin/EagleShell.exe.config ================================================================== --- Externals/Eagle/bin/EagleShell.exe.config +++ Externals/Eagle/bin/EagleShell.exe.config @@ -1,11 +1,11 @@ - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {1B7C6ACE-35AA-481C-9CF6-56B702E3E043} - Library - Properties - SQLiteProvider - SQLiteProvider - $(MSBuildProjectDirectory)\.. - true - 2005 - - - - $(BinaryOutputPath) - - - true - full - false - DEBUG;TRACE - prompt - - - pdbonly - true - TRACE - prompt - - - - - - - - - - - - - True - True - Settings.settings - - - - - True - True - ApplicationSql.resx - - - True - True - MembershipSql.resx - - - - True - True - RoleSql.resx - - - - - - - True - True - SiteMapSql.resx - SQLiteProvider - - - - - - - Designer - ResXFileCodeGenerator - ApplicationSql.Designer.cs - SQLiteProvider - - - Designer - ResXFileCodeGenerator - MembershipSql.Designer.cs - SQLiteProvider - - - Designer - ResXFileCodeGenerator - RoleSql.Designer.cs - SQLiteProvider - - - Designer - ResXFileCodeGenerator - SiteMapSql.Designer.cs - SQLiteProvider - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - - - - Index: SQLite.Designer/AssemblyInfo.cs ================================================================== --- SQLite.Designer/AssemblyInfo.cs +++ SQLite.Designer/AssemblyInfo.cs @@ -41,7 +41,7 @@ // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.81.0")] -[assembly: AssemblyFileVersion("1.0.81.0")] +[assembly: AssemblyVersion("1.0.78.0")] +[assembly: AssemblyFileVersion("1.0.78.0")] Index: SQLite.Designer/Design/ForeignKey.cs ================================================================== --- SQLite.Designer/Design/ForeignKey.cs +++ SQLite.Designer/Design/ForeignKey.cs @@ -281,13 +281,11 @@ } [DefaultProperty("From")] internal class ForeignKey : IHaveConnection, ICloneable { - internal Table _table; - internal int _id; - internal int _ordinal; + internal Table _table; internal ForeignKeyFromItem _from; internal ForeignKeyToItem _to; internal string _name; internal string _onUpdate; internal string _onDelete; @@ -294,13 +292,11 @@ internal string _match; private bool _dirty; private ForeignKey(ForeignKey source) { - _table = source._table; - _id = source._id; - _ordinal = source._ordinal; + _table = source._table; _from = new ForeignKeyFromItem(this, source._from.Column); _to = new ForeignKeyToItem(this, source._to.Catalog, source._to.Table, source._to.Column); _name = source._name; _onUpdate = source._onUpdate; _onDelete = source._onDelete; @@ -326,24 +322,20 @@ internal ForeignKey(DbConnection cnn, Table table, DataRow row) { _table = table; if (row != null) - { - _id = (int)row["FKEY_ID"]; - _ordinal = (int)row["FKEY_FROM_ORDINAL_POSITION"]; + { _from = new ForeignKeyFromItem(this, row["FKEY_FROM_COLUMN"].ToString()); _to = new ForeignKeyToItem(this, row["FKEY_TO_CATALOG"].ToString(), row["FKEY_TO_TABLE"].ToString(), row["FKEY_TO_COLUMN"].ToString()); _name = row["CONSTRAINT_NAME"].ToString(); _onUpdate = row["FKEY_ON_UPDATE"].ToString(); _onDelete = row["FKEY_ON_DELETE"].ToString(); _match = row["FKEY_MATCH"].ToString(); } else - { - _id = -1; - _ordinal = -1; + { _from = new ForeignKeyFromItem(this, ""); _to = new ForeignKeyToItem(this, _table.Catalog, "", ""); } } @@ -363,11 +355,11 @@ { get { if (String.IsNullOrEmpty(_name) == false) return _name; - return String.Format(CultureInfo.InvariantCulture, "FK_{0}_{1}_{2}", _from.Table, _id, _ordinal); + return String.Format(CultureInfo.InvariantCulture, "FK_{0}_{1}_{2}_{3}", _from.Table, _from.Column, _to.Table, _to.Column); } set { if (_name != value) { @@ -388,27 +380,11 @@ public DbConnection GetConnection() { return ((IHaveConnection)_table).GetConnection(); } - #endregion - - [DisplayName("Id")] - [Category("Id")] - [Description("The identifier of this foreign key.")] - public int Id - { - get { return _id; } - } - - [DisplayName("Ordinal")] - [Category("Ordinal")] - [Description("The column ordinal of this foreign key.")] - public int Ordinal - { - get { return _ordinal; } - } + #endregion [DisplayName("From Key")] [Category("From")] [Description("The source column in the current table that refers to the foreign key.")] public ForeignKeyFromItem From Index: SQLite.Designer/Design/Table.cs ================================================================== --- SQLite.Designer/Design/Table.cs +++ SQLite.Designer/Design/Table.cs @@ -406,15 +406,39 @@ } } builder.Append(separator); builder.AppendFormat("CONSTRAINT [CK_{0}_{1}] CHECK {2}", Name, n + 1, check); } - - if (ForeignKeys.Count > 0) + + List keys = new List(); + + for (int x = 0; x < ForeignKeys.Count; x++) + { + ForeignKey key = ForeignKeys[x]; + + if (String.IsNullOrEmpty(key.From.Column) == true || String.IsNullOrEmpty(key.From.Catalog) == true || + String.IsNullOrEmpty(key.To.Table) == true || String.IsNullOrEmpty(key.To.Column) == true) + continue; + + if (keys.Count > 0) + { + if (keys[0].Name == key.Name && keys[0].To.Catalog == key.To.Catalog && keys[0].To.Table == key.To.Table) + { + keys.Add(key); + continue; + } + builder.Append(separator); + WriteFKeys(keys, builder); + keys.Clear(); + } + keys.Add(key); + } + + if (keys.Count > 0) { - builder.Append(separator); - WriteFKeys(ForeignKeys, builder); + builder.Append(separator); + WriteFKeys(keys, builder); } builder.Append("\r\n);\r\n"); // Rebuilding an existing table @@ -470,66 +494,41 @@ } builder.AppendLine(); } return builder.ToString(); - } - - private void WriteFKeys(List keys, StringBuilder builder) - { - for (int index = 0; index < keys.Count; ) - { - ForeignKey key = keys[index]; - - if (index > 0) - builder.Append(",\r\n "); - - builder.AppendFormat( - "CONSTRAINT [{0}] FOREIGN KEY (", key.Name); - - int startIndex = index; - - do - { - builder.AppendFormat("{0}[{1}]", - index > startIndex ? ", " : String.Empty, - keys[index].From.Column); - - index++; - } while (index < keys.Count && keys[index].Id == key.Id); - - builder.AppendFormat(") REFERENCES [{0}]", key.To.Table); - - if (!String.IsNullOrEmpty(key.To.Column)) - { - builder.Append(" ("); - index = startIndex; - - do - { - builder.AppendFormat("{0}[{1}]", - index > startIndex ? ", " : String.Empty, - keys[index].To.Column); - - index++; - } while (index < keys.Count && keys[index].Id == key.Id); - - builder.Append(')'); - } - - if (!String.IsNullOrEmpty(key.Match)) - builder.AppendFormat(" MATCH {0}", key.Match); - - if (!String.IsNullOrEmpty(key.OnUpdate)) - builder.AppendFormat(" ON UPDATE {0}", key.OnUpdate); - - if (!String.IsNullOrEmpty(key.OnDelete)) - builder.AppendFormat(" ON DELETE {0}", key.OnDelete); - - if (index == startIndex) - index++; - } + } + + private void WriteFKeys(List keys, StringBuilder builder) + { + builder.AppendFormat("CONSTRAINT [{0}] FOREIGN KEY (", keys[0].Name); + string separator = ""; + + foreach (ForeignKey key in keys) + { + builder.AppendFormat("{0}[{1}]", separator, key.From.Column); + separator = ", "; + } + + builder.AppendFormat(") REFERENCES [{0}] (", keys[0].To.Table); + + separator = ""; + foreach (ForeignKey key in keys) + { + builder.AppendFormat("{0}[{1}]", separator, key.To.Column); + separator = ", "; + } + builder.Append(")"); + + if (!String.IsNullOrEmpty(keys[0].Match)) + builder.AppendFormat(" MATCH {0}", keys[0].Match); + + if (!String.IsNullOrEmpty(keys[0].OnUpdate)) + builder.AppendFormat(" ON UPDATE {0}", keys[0].OnUpdate); + + if (!String.IsNullOrEmpty(keys[0].OnDelete)) + builder.AppendFormat(" ON DELETE {0}", keys[0].OnDelete); } [Browsable(false)] public override ViewTableBase DesignTable { DELETED SQLite.Designer/SQLite.Designer.2005.csproj Index: SQLite.Designer/SQLite.Designer.2005.csproj ================================================================== --- SQLite.Designer/SQLite.Designer.2005.csproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198} - Library - Properties - SQLite.Designer - SQLite.Designer - $(MSBuildProjectDirectory)\.. - true - 2005 - - - - - $(BinaryOutputPath) - $(BinaryOutputPath)SQLite.Designer.xml - - - true - full - false - DEBUG;TRACE - prompt - - - pdbonly - true - TRACE - prompt - - - - - - - - - - False - - - False - False - - - False - - - False - False - - - False - - - False - - - False - - - False - - - - - - Form - - - ChangePasswordDialog.cs - - - Form - - - ChangeScriptDialog.cs - - - - - - - - - - - - - Component - - - UserControl - - - TableDesignerDoc.cs - - - UserControl - - - ViewDesignerDoc.cs - - - - - - - - UserControl - - - SQLiteConnectionUIControl.cs - - - - - - - - - - - Form - - - TableNameDialog.cs - - - True - True - VSPackage.resx - - - - - 1000 - - - - - - ResXFileCodeGenerator - VSPackage.Designer.cs - true - Designer - - - - - Designer - ChangePasswordDialog.cs - - - Designer - TableDesignerDoc.cs - - - ViewDesignerDoc.cs - - - Designer - SQLiteConnectionUIControl.cs - - - - TableNameDialog.cs - - - - - ChangeScriptDialog.cs - - - - - - - - - - - $(ProgramFiles)\Visual Studio 2005 SDK\2007.02\ - $(ProgramFiles%28x86%29)\Visual Studio 2005 SDK\2007.02\ - - - - - MissingVsSdk - - - - Index: SQLite.Designer/SQLite.Designer.2008.csproj ================================================================== --- SQLite.Designer/SQLite.Designer.2008.csproj +++ SQLite.Designer/SQLite.Designer.2008.csproj @@ -22,11 +22,10 @@ $(MSBuildProjectDirectory)\.. true 2008 - $(BinaryOutputPath) $(BinaryOutputPath)SQLite.Designer.xml @@ -194,28 +193,13 @@ - - - - MissingVsSdk - - Index: SQLite.Designer/SQLite.Designer.2010.csproj ================================================================== --- SQLite.Designer/SQLite.Designer.2010.csproj +++ SQLite.Designer/SQLite.Designer.2010.csproj @@ -21,11 +21,10 @@ 3.5 $(MSBuildProjectDirectory)\.. 2010 - $(BinaryOutputPath) $(BinaryOutputPath)SQLite.Designer.xml @@ -193,28 +192,13 @@ - - - - MissingVsSdk - - DELETED SQLite.Designer/SQLiteDataViewSupport2005.xml Index: SQLite.Designer/SQLiteDataViewSupport2005.xml ================================================================== --- SQLite.Designer/SQLiteDataViewSupport2005.xml +++ /dev/null @@ -1,386 +0,0 @@ - - - - - - - - - SQLite - - - - SQLite [{Root.Server}] - - - - - - - - - - Tables - - - - - - - - - - - - - - - - - - System Tables - - - - - - - - - - - - - - - - - Views - - - - - - - - {View.Name} - - - - - - - - - - - - - - - - - - Columns - - - - - - - - - - - - - - - - - - - Indexes - - - - - - - - - - - - - - - - Foreign Keys - - - - - - - - - - - - - - Triggers - - - - - - - - - - - - - Columns - - - - - - - - - - - - - - Triggers - - - - - - - - - - - - - - - - - - - - Catalog - - - - - - - - - - - - - - - - - - - - - - - - Catalog - - - - - - Updatable - - - - - - - - - - - - - - - - - - - - - - - Catalog - - - - - - - - - - - Data Type - - - Allow Nulls - - - Default Value - - - - - - - - - - - - - - Catalog - - - - - - - - - Is Unique - - - Primary Key - - - - - - - - - - - - - - - - - Catalog - - - - - - - - - - - - - - - Catalog - - - - - - - - - - - Data Type - - - Allow Nulls - - - Default Value - - - Primary Key - - - - - - - - - - - - - - Catalog - - - - - - - - - - Referenced Database - - - - Referenced Table - - - - - - - - - - - - (Identity) - (Location) - (Source) - References - - Index: SQLite.Designer/VSPackage.Designer.cs ================================================================== --- SQLite.Designer/VSPackage.Designer.cs +++ SQLite.Designer/VSPackage.Designer.cs @@ -66,11 +66,11 @@ resourceCulture = value; } } /// - /// Looks up a localized string similar to RZE1PAAIMRZRE2CKM3CIRRIREIJQR1PTAEHTRHKTCPP1KKRRJQK9CTM9ZHMRETI9E9J8REKEA1MER9PDKQDIH8HMRRH2DIACHIP1KHK2IAZKM8R0EZRTKDHADII9ICCH. + /// Looks up a localized string similar to MHM2ZQETQKDTJEPTC1MTQCZ1R1KQEMAPZHETDZPZI9RPJ0E0DHAHKCHZPKQ8AQZICADHKIZ1JAQED8IDEHZPZKZEIKAQERHPRCQMAMRKDEZZQRDRDHJEZIKECZPDIIKC. /// internal static string _400 { get { return ResourceManager.GetString("400", resourceCulture); } Index: SQLite.Designer/VSPackage.resx ================================================================== --- SQLite.Designer/VSPackage.resx +++ SQLite.Designer/VSPackage.resx @@ -125,11 +125,11 @@ The database and its metadata will be re-encrypted using the supplied password as a hash. - RZE1PAAIMRZRE2CKM3CIRRIREIJQR1PTAEHTRHKTCPP1KKRRJQK9CTM9ZHMRETI9E9J8REKEA1MER9PDKQDIH8HMRRH2DIACHIP1KHK2IAZKM8R0EZRTKDHADII9ICCH + MHM2ZQETQKDTJEPTC1MTQCZ1R1KQEMAPZHETDZPZI9RPJ0E0DHAHKCHZPKQ8AQZICADHKIZ1JAQED8IDEHZPZKZEIKAQERHPRCQMAMRKDEZZQRDRDHJEZIKECZPDIIKC Resources\info.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a DELETED SQLite.Designer/plk.txt Index: SQLite.Designer/plk.txt ================================================================== --- SQLite.Designer/plk.txt +++ /dev/null @@ -1,24 +0,0 @@ -Package Load Key (PLK) - - RZE1PAAIMRZRE2CKM3CIRRIREIJQR1PTAEHTRHKTCPP1KKRRJQK9CTM9ZHMRETI9 - E9J8REKEA1MER9PDKQDIH8HMRRH2DIACHIP1KHK2IAZKM8R0EZRTKDHADII9ICCH - -Company Name - - http://system.data.sqlite.org/ - -Package Name - - System.Data.SQLite Designer Package - -Package GUID - - {dcbe6c8d-0e57-4099-a183-98ff74c64d9c} - -PLK Version - - 1.0 - -Min. Visual Studio Version - - Visual Studio 2005 Index: SQLite.Designer/source.extension.vsixmanifest ================================================================== --- SQLite.Designer/source.extension.vsixmanifest +++ SQLite.Designer/source.extension.vsixmanifest @@ -1,11 +1,11 @@ - System.Data.SQLite Designer - http://system.data.sqlite.org/ - 1.0.81.0 + SQLite Designer + Robert Simpson + 1.0.78.0 ADO.NET Data Designer for SQLite 1033 false DELETED SQLite.Interop/SQLite.Interop.2005.vcproj Index: SQLite.Interop/SQLite.Interop.2005.vcproj ================================================================== --- SQLite.Interop/SQLite.Interop.2005.vcproj +++ /dev/null @@ -1,1183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: SQLite.Interop/SQLite.Interop.2008.vcproj ================================================================== --- SQLite.Interop/SQLite.Interop.2008.vcproj +++ SQLite.Interop/SQLite.Interop.2008.vcproj @@ -30,11 +30,11 @@ @@ -51,11 +51,11 @@ Name="VCMIDLTool" /> @@ -148,11 +148,11 @@ TargetEnvironment="3" /> @@ -244,11 +244,11 @@ Name="VCMIDLTool" /> @@ -335,11 +335,11 @@ TargetEnvironment="3" /> @@ -1167,11 +1167,11 @@ Index: SQLite.Interop/SQLite.Interop.2010.vcxproj ================================================================== --- SQLite.Interop/SQLite.Interop.2010.vcxproj +++ SQLite.Interop/SQLite.Interop.2010.vcxproj @@ -48,11 +48,11 @@ SQLite.Interop Win32Proj - + true Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions) false Default MultiThreadedDebugDLL Level4 ProgramDatabase @@ -164,11 +164,11 @@ Disabled - WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions) false Default MultiThreadedDebugDLL Level4 ProgramDatabase @@ -205,11 +205,11 @@ Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions) false Default MultiThreadedDebugDLL Level4 ProgramDatabase @@ -233,18 +233,17 @@ true $(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32 true - XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\$(Platform)\" /D /E /V /I /F /H /Y -XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y + XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y Disabled - WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions) false Default MultiThreadedDebugDLL Level4 ProgramDatabase @@ -268,20 +267,19 @@ true $(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32 true - XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\$(Platform)\" /D /E /V /I /F /H /Y -XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y + XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y Full true Speed - WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions) false Default true MultiThreadedDLL Level4 @@ -320,11 +318,11 @@ Full true Speed - WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions) false Default true MultiThreadedDLL Level4 @@ -363,11 +361,11 @@ Full true Speed - WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions) false Default true MultiThreadedDLL Level4 @@ -392,20 +390,19 @@ true $(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32 true - XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\$(Platform)\" /D /E /V /I /F /H /Y -XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y + XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y Full true Speed - WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions) false Default true MultiThreadedDLL Level4 @@ -430,12 +427,11 @@ true $(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32 true - XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\$(Platform)\" /D /E /V /I /F /H /Y -XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y + XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y true @@ -450,11 +446,11 @@ true - + Index: SQLite.Interop/SQLite.Interop.2010.vcxproj.filters ================================================================== --- SQLite.Interop/SQLite.Interop.2010.vcxproj.filters +++ SQLite.Interop/SQLite.Interop.2010.vcxproj.filters @@ -44,11 +44,11 @@ Property Files - + Property Files DELETED SQLite.Interop/SQLite.Interop.CE.2005.vcproj Index: SQLite.Interop/SQLite.Interop.CE.2005.vcproj ================================================================== --- SQLite.Interop/SQLite.Interop.CE.2005.vcproj +++ /dev/null @@ -1,873 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: SQLite.Interop/SQLite.Interop.CE.2008.vcproj ================================================================== --- SQLite.Interop/SQLite.Interop.CE.2008.vcproj +++ SQLite.Interop/SQLite.Interop.CE.2008.vcproj @@ -1,14 +1,6 @@ - @@ -55,14 +47,13 @@ /> @@ -153,13 +144,12 @@ @@ -250,14 +240,13 @@ /> @@ -344,14 +333,13 @@ /> @@ -439,13 +427,12 @@ @@ -535,13 +522,12 @@ DELETED SQLite.Interop/SQLite.Interop.Static.2005.vcproj Index: SQLite.Interop/SQLite.Interop.Static.2005.vcproj ================================================================== --- SQLite.Interop/SQLite.Interop.Static.2005.vcproj +++ /dev/null @@ -1,1183 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: SQLite.Interop/SQLite.Interop.Static.2008.vcproj ================================================================== --- SQLite.Interop/SQLite.Interop.Static.2008.vcproj +++ SQLite.Interop/SQLite.Interop.Static.2008.vcproj @@ -30,11 +30,11 @@ @@ -51,11 +51,11 @@ Name="VCMIDLTool" /> @@ -148,11 +148,11 @@ TargetEnvironment="3" /> @@ -244,11 +244,11 @@ Name="VCMIDLTool" /> @@ -335,11 +335,11 @@ TargetEnvironment="3" /> @@ -1167,11 +1167,11 @@ Index: SQLite.Interop/SQLite.Interop.Static.2010.vcxproj ================================================================== --- SQLite.Interop/SQLite.Interop.Static.2010.vcxproj +++ SQLite.Interop/SQLite.Interop.Static.2010.vcxproj @@ -48,11 +48,11 @@ SQLite.Interop Win32Proj - + true Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions) false Default MultiThreadedDebug Level4 ProgramDatabase @@ -164,11 +164,11 @@ Disabled - WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions) false Default MultiThreadedDebug Level4 ProgramDatabase @@ -205,11 +205,11 @@ Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions) false Default MultiThreadedDebug Level4 ProgramDatabase @@ -233,18 +233,17 @@ true $(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32 true - XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\$(Platform)\" /D /E /V /I /F /H /Y -XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y + XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y Disabled - WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;x64;_DEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_DEBUG_DEFINES);%(PreprocessorDefinitions) false Default MultiThreadedDebug Level4 ProgramDatabase @@ -268,20 +267,19 @@ true $(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32 true - XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\$(Platform)\" /D /E /V /I /F /H /Y -XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y + XCOPY "$(TargetPath)" "$(OutDir)..\..\Debug\bin\" /D /E /V /I /F /H /Y Full true Speed - WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions) false Default true MultiThreaded Level4 @@ -320,11 +318,11 @@ Full true Speed - WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions) false Default true MultiThreaded Level4 @@ -363,11 +361,11 @@ Full true Speed - WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions) false Default true MultiThreaded Level4 @@ -392,20 +390,19 @@ true $(ProjectName), processorArchitecture=x86, version=$(INTEROP_MANIFEST_VERSION), type=win32 true - XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\$(Platform)\" /D /E /V /I /F /H /Y -XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y + XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y Full true Speed - WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);$(INTEROP_EXTRA_DEFINES);%(PreprocessorDefinitions) + WIN32;x64;NDEBUG;_WINDOWS;_USRDLL;$(SQLITE_COMMON_DEFINES);$(SQLITE_EXTRA_DEFINES);$(SQLITE_RELEASE_DEFINES);%(PreprocessorDefinitions) false Default true MultiThreaded Level4 @@ -430,12 +427,11 @@ true $(ProjectName), processorArchitecture=amd64, version=$(INTEROP_MANIFEST_VERSION), type=win32 true - XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\$(Platform)\" /D /E /V /I /F /H /Y -XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y + XCOPY "$(TargetPath)" "$(OutDir)..\..\Release\bin\" /D /E /V /I /F /H /Y true @@ -450,11 +446,11 @@ true - + Index: SQLite.Interop/SQLite.Interop.Static.2010.vcxproj.filters ================================================================== --- SQLite.Interop/SQLite.Interop.Static.2010.vcxproj.filters +++ SQLite.Interop/SQLite.Interop.Static.2010.vcxproj.filters @@ -44,11 +44,11 @@ Property Files - + Property Files DELETED SQLite.Interop/props/SQLite.Interop.2005.vsprops Index: SQLite.Interop/props/SQLite.Interop.2005.vsprops ================================================================== --- SQLite.Interop/props/SQLite.Interop.2005.vsprops +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - DELETED SQLite.Interop/props/SQLite.Interop.2008.vsprops Index: SQLite.Interop/props/SQLite.Interop.2008.vsprops ================================================================== --- SQLite.Interop/props/SQLite.Interop.2008.vsprops +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - DELETED SQLite.Interop/props/SQLite.Interop.2010.props Index: SQLite.Interop/props/SQLite.Interop.2010.props ================================================================== --- SQLite.Interop/props/SQLite.Interop.2010.props +++ /dev/null @@ -1,63 +0,0 @@ - - - - - 2010 - 081 - 1.0.81.0 - 1,0,81,0 - INTEROP_EXTENSION_FUNCTIONS=1;INTEROP_CODEC=1 - /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteCommand.bmp,System.Data.SQLite.SQLiteCommand.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteConnection.bmp,System.Data.SQLite.SQLiteConnection.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteDataAdapter.bmp,System.Data.SQLite.SQLiteDataAdapter.bmp - $(ProjectDir)..\System.Data.SQLite\System.Data.SQLite.snk - SQLite.Interop - System.Data.SQLite - - - <_ProjectFileVersion>10.0.30319.1 - - - - $(ConfigurationYear) - true - - - $(INTEROP_BUILD_NUMBER) - true - - - $(INTEROP_MANIFEST_VERSION) - true - - - $(INTEROP_RC_VERSION) - true - - - $(INTEROP_EXTRA_DEFINES) - true - - - $(INTEROP_ASSEMBLY_RESOURCES) - true - - - $(INTEROP_KEY_FILE) - true - - - $(INTEROP_NATIVE_NAME) - true - - - $(INTEROP_MIXED_NAME) - true - - - ADDED SQLite.Interop/props/SQLite.Interop.props Index: SQLite.Interop/props/SQLite.Interop.props ================================================================== --- /dev/null +++ SQLite.Interop/props/SQLite.Interop.props @@ -0,0 +1,58 @@ + + + + + 2010 + 078 + 1.0.78.0 + 1,0,78,0 + /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteCommand.bmp,System.Data.SQLite.SQLiteCommand.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteConnection.bmp,System.Data.SQLite.SQLiteConnection.bmp /ASSEMBLYRESOURCE:..\System.Data.SQLite\SQLiteDataAdapter.bmp,System.Data.SQLite.SQLiteDataAdapter.bmp + $(ProjectDir)..\System.Data.SQLite\System.Data.SQLite.snk + SQLite.Interop + System.Data.SQLite + + + <_ProjectFileVersion>10.0.30319.1 + + + + $(ConfigurationYear) + true + + + $(INTEROP_BUILD_NUMBER) + true + + + $(INTEROP_MANIFEST_VERSION) + true + + + $(INTEROP_RC_VERSION) + true + + + $(INTEROP_ASSEMBLY_RESOURCES) + true + + + $(INTEROP_KEY_FILE) + true + + + $(INTEROP_NATIVE_NAME) + true + + + $(INTEROP_MIXED_NAME) + true + + + ADDED SQLite.Interop/props/SQLite.Interop.vsprops Index: SQLite.Interop/props/SQLite.Interop.vsprops ================================================================== --- /dev/null +++ SQLite.Interop/props/SQLite.Interop.vsprops @@ -0,0 +1,55 @@ + + + + + + + + + + + + Index: SQLite.Interop/props/sqlite3.props ================================================================== --- SQLite.Interop/props/sqlite3.props +++ SQLite.Interop/props/sqlite3.props @@ -7,12 +7,12 @@ * Released to the public domain, use at your own risk! * --> - 3.7.12.0 - 3,7,12,0 + 3.7.10.0 + 3,7,10,0 SQLITE_THREADSAFE=1;SQLITE_ENABLE_COLUMN_METADATA=1;SQLITE_ENABLE_STAT3=1;SQLITE_ENABLE_FTS3=1;SQLITE_ENABLE_LOAD_EXTENSION=1;SQLITE_ENABLE_RTREE=1;SQLITE_SOUNDEX=1 SQLITE_HAS_CODEC=1 SQLITE_OMIT_WAL=1 SQLITE_DEBUG=1;SQLITE_MEMDEBUG=1 SQLITE_WIN32_MALLOC=1 Index: SQLite.Interop/props/sqlite3.vsprops ================================================================== --- SQLite.Interop/props/sqlite3.vsprops +++ SQLite.Interop/props/sqlite3.vsprops @@ -12,16 +12,16 @@ Version="8.00" Name="sqlite3" > -**
  • [[SQLITE_FCNTL_SIZE_HINT]] +** ** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS ** layer a hint of how large the database file will grow to be during the ** current transaction. This hint is not guaranteed to be accurate but it ** is often close. The underlying VFS might choose to preallocate database ** file space based on this hint in order to help writes to the database ** file run faster. ** -**
  • [[SQLITE_FCNTL_CHUNK_SIZE]] ** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS ** extends and truncates the database file in chunks of a size specified ** by the user. The fourth argument to [sqlite3_file_control()] should ** point to an integer (type int) containing the new chunk-size to use ** for the nominated database. Allocating database file space in large ** chunks (say 1MB at a time), may reduce file-system fragmentation and ** improve performance on some systems. ** -**
  • [[SQLITE_FCNTL_FILE_POINTER]] ** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer ** to the [sqlite3_file] object associated with a particular database ** connection. See the [sqlite3_file_control()] documentation for ** additional information. ** -**
  • [[SQLITE_FCNTL_SYNC_OMITTED]] ** ^(The [SQLITE_FCNTL_SYNC_OMITTED] opcode is generated internally by ** SQLite and sent to all VFSes in place of a call to the xSync method ** when the database connection has [PRAGMA synchronous] set to OFF.)^ ** Some specialized VFSes need this signal in order to operate correctly ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most @@ -1301,11 +1295,10 @@ ** VFSes do not need this signal and should silently ignore this opcode. ** Applications should not call [sqlite3_file_control()] with this ** opcode as doing so may disrupt the operation of the specialized VFSes ** that do require it. ** -**
  • [[SQLITE_FCNTL_WIN32_AV_RETRY]] ** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic ** retry counts and intervals for certain disk I/O operations for the ** windows [VFS] in order to provide robustness in the presence of ** anti-virus programs. By default, the windows VFS will retry file read, ** file write, and file delete operations up to 10 times, with a delay @@ -1318,13 +1311,12 @@ ** integer is the delay. If either integer is negative, then the setting ** is not changed but instead the prior value of that setting is written ** into the array entry, allowing the current retry settings to be ** interrogated. The zDbName parameter is ignored. ** -**
  • [[SQLITE_FCNTL_PERSIST_WAL]] ** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the -** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** persistent [WAL | Write AHead Log] setting. By default, the auxiliary ** write ahead log and shared memory files used for transaction control ** are automatically deleted when the latest connection to the database ** closes. Setting persistent WAL mode causes those files to persist after ** close. Persisting the files is useful when other processes that do not ** have write permission on the directory containing the database file want @@ -1333,27 +1325,24 @@ ** [sqlite3_file_control()] for this opcode should be a pointer to an integer. ** That integer is 0 to disable persistent WAL mode or 1 to enable persistent ** WAL mode. If the integer is -1, then it is overwritten with the current ** WAL persistence setting. ** -**
  • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] ** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the ** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting ** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the ** xDeviceCharacteristics methods. The fourth parameter to ** [sqlite3_file_control()] for this opcode should be a pointer to an integer. ** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage ** mode. If the integer is -1, then it is overwritten with the current ** zero-damage mode setting. ** -**
  • [[SQLITE_FCNTL_OVERWRITE]] ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening ** a write transaction to indicate that, unless it is rolled back for some ** reason, the entire database file will be overwritten by the current ** transaction. This is used by VACUUM operations. ** -**
  • [[SQLITE_FCNTL_VFSNAME]] ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of ** all [VFSes] in the VFS stack. The names are of all VFS shims and the ** final bottom-level VFS are written into memory obtained from ** [sqlite3_malloc()] and the result is stored in the char* variable ** that the fourth parameter of [sqlite3_file_control()] points to. @@ -1360,34 +1349,10 @@ ** The caller is responsible for freeing the memory when done. As with ** all file-control actions, there is no guarantee that this will actually ** do anything. Callers should initialize the char* variable to a NULL ** pointer in case this file-control is not implemented. This file-control ** is intended for diagnostic use only. -** -**
  • [[SQLITE_FCNTL_PRAGMA]] -** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] -** file control is sent to the open [sqlite3_file] object corresponding -** to the database file to which the pragma statement refers. ^The argument -** to the [SQLITE_FCNTL_PRAGMA] file control is an array of -** pointers to strings (char**) in which the second element of the array -** is the name of the pragma and the third element is the argument to the -** pragma or NULL if the pragma has no argument. ^The handler for an -** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element -** of the char** argument point to a string obtained from [sqlite3_mprintf()] -** or the equivalent and that string will become the result of the pragma or -** the error message if the pragma fails. ^If the -** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal -** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] -** file control returns [SQLITE_OK], then the parser assumes that the -** VFS has handled the PRAGMA itself and the parser generates a no-op -** prepared statement. ^If the [SQLITE_FCNTL_PRAGMA] file control returns -** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means -** that the VFS encountered an error while handling the [PRAGMA] and the -** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] -** file control occurs at the beginning of pragma statement analysis and so -** it is able to override built-in [PRAGMA] statements. -** */ #define SQLITE_FCNTL_LOCKSTATE 1 #define SQLITE_GET_LOCKPROXYFILE 2 #define SQLITE_SET_LOCKPROXYFILE 3 #define SQLITE_LAST_ERRNO 4 @@ -1398,11 +1363,10 @@ #define SQLITE_FCNTL_WIN32_AV_RETRY 9 #define SQLITE_FCNTL_PERSIST_WAL 10 #define SQLITE_FCNTL_OVERWRITE 11 #define SQLITE_FCNTL_VFSNAME 12 #define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13 -#define SQLITE_FCNTL_PRAGMA 14 /* ** CAPI3REF: Mutex Handle ** ** The mutex module within SQLite defines [sqlite3_mutex] to be an @@ -2096,11 +2060,11 @@ ** database connection is opened. By default, URI handling is globally ** disabled. The default value may be changed by compiling with the ** [SQLITE_USE_URI] symbol defined. ** ** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] -**
    SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE +**
    SQLITE_CONFIG_PCACHE and SQLITE_CONFNIG_GETPCACHE **
    These options are obsolete and should not be used by new code. ** They are retained for backwards compatibility but are now no-ops. ** */ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ @@ -3228,18 +3192,13 @@ ** has no explicit value, then sqlite3_uri_parameter(F,P) returns ** a pointer to an empty string. ** ** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean ** parameter and returns true (1) or false (0) according to the value -** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the -** value of query parameter P is one of "yes", "true", or "on" in any -** case or if the value begins with a non-zero number. The -** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of -** query parameter P is one of "no", "false", or "off" in any case or -** if the value begins with a numeric zero. If P is not a query -** parameter on F or if the value of P is does not match any of the -** above, then sqlite3_uri_boolean(F,P,B) returns (B!=0). +** of P. The value of P is true if it is "yes" or "true" or "on" or +** a non-zero number and is false otherwise. If P is not a query parameter +** on F then sqlite3_uri_boolean(F,P,B) returns (B!=0). ** ** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a ** 64-bit signed integer and returns that integer, or D if P does not ** exist. If the value of P is something other than an integer, then ** zero is returned. @@ -5048,19 +5007,10 @@ ** will be an absolute pathname, even if the filename used ** to open the database originally was a URI or relative pathname. */ SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); -/* -** CAPI3REF: Determine if a database is read-only -** -** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N -** of connection D is read-only, 0 if it is read/write, or -1 if N is not -** the name of a database on connection D. -*/ -SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName); - /* ** CAPI3REF: Find the next prepared statement ** ** ^This interface returns a pointer to the next [prepared statement] after ** pStmt associated with the [database connection] pDb. ^If pStmt is NULL @@ -6555,21 +6505,10 @@ ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(
    SQLITE_DBSTATUS_CACHE_MISS
    **
    This parameter returns the number of pager cache misses that have ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ** is always 0. **
    -** -** [[SQLITE_DBSTATUS_CACHE_WRITE]] ^(
    SQLITE_DBSTATUS_CACHE_WRITE
    -**
    This parameter returns the number of dirty cache entries that have -** been written to disk. Specifically, the number of pages written to the -** wal file in wal mode databases, or the number of pages written to the -** database file in rollback mode databases. Any pages written as part of -** transaction rollback or database recovery operations are not included. -** If an IO or other error occurs while writing a page to disk, the effect -** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The -** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0. -**
    ** */ #define SQLITE_DBSTATUS_LOOKASIDE_USED 0 #define SQLITE_DBSTATUS_CACHE_USED 1 #define SQLITE_DBSTATUS_SCHEMA_USED 2 @@ -6577,12 +6516,11 @@ #define SQLITE_DBSTATUS_LOOKASIDE_HIT 4 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6 #define SQLITE_DBSTATUS_CACHE_HIT 7 #define SQLITE_DBSTATUS_CACHE_MISS 8 -#define SQLITE_DBSTATUS_CACHE_WRITE 9 -#define SQLITE_DBSTATUS_MAX 9 /* Largest defined DBSTATUS */ +#define SQLITE_DBSTATUS_MAX 8 /* Largest defined DBSTATUS */ /* ** CAPI3REF: Prepared Statement Status ** @@ -7194,16 +7132,15 @@ /* ** CAPI3REF: String Comparison ** -** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications -** and extensions to compare the contents of two buffers containing UTF-8 -** strings in a case-independent fashion, using the same definition of "case -** independence" that SQLite uses internally when comparing identifiers. +** ^The [sqlite3_strnicmp()] API allows applications and extensions to +** compare the contents of two buffers containing UTF-8 strings in a +** case-independent fashion, using the same definition of case independence +** that SQLite uses internally when comparing identifiers. */ -SQLITE_API int sqlite3_stricmp(const char *, const char *); SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); /* ** CAPI3REF: Error Logging Interface ** @@ -7534,15 +7471,11 @@ ** SELECT ... FROM WHERE MATCH $zGeom(... params ...) */ SQLITE_API int sqlite3_rtree_geometry_callback( sqlite3 *db, const char *zGeom, -#ifdef SQLITE_RTREE_INT_ONLY - int (*xGeom)(sqlite3_rtree_geometry*, int n, sqlite3_int64 *a, int *pRes), -#else - int (*xGeom)(sqlite3_rtree_geometry*, int n, double *a, int *pRes), -#endif + int (*xGeom)(sqlite3_rtree_geometry *, int nCoord, double *aCoord, int *pRes), void *pContext ); /* @@ -8080,17 +8013,13 @@ */ #define ArraySize(X) ((int)(sizeof(X)/sizeof(X[0]))) /* ** The following value as a destructor means to use sqlite3DbFree(). -** The sqlite3DbFree() routine requires two parameters instead of the -** one parameter that destructors normally want. So we have to introduce -** this magic value that the code knows to handle differently. Any -** pointer will work here as long as it is distinct from SQLITE_STATIC -** and SQLITE_TRANSIENT. +** This is an internal extension to SQLITE_STATIC and SQLITE_TRANSIENT. */ -#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3MallocSize) +#define SQLITE_DYNAMIC ((sqlite3_destructor_type)sqlite3DbFree) /* ** When SQLITE_OMIT_WSD is defined, it means that the target platform does ** not support Writable Static Data (WSD) such as global and static variables. ** All variables must either be on the stack or dynamically allocated from @@ -8246,13 +8175,14 @@ ** ** NOTE: These values must match the corresponding PAGER_ values in ** pager.h. */ #define BTREE_OMIT_JOURNAL 1 /* Do not create or use a rollback journal */ -#define BTREE_MEMORY 2 /* This is an in-memory DB */ -#define BTREE_SINGLE 4 /* The file contains at most 1 b-tree */ -#define BTREE_UNORDERED 8 /* Use of a hash implementation is OK */ +#define BTREE_NO_READLOCK 2 /* Omit readlocks on readonly files */ +#define BTREE_MEMORY 4 /* This is an in-memory DB */ +#define BTREE_SINGLE 8 /* The file contains at most 1 b-tree */ +#define BTREE_UNORDERED 16 /* Use of a hash implementation is OK */ SQLITE_PRIVATE int sqlite3BtreeClose(Btree*); SQLITE_PRIVATE int sqlite3BtreeSetCacheSize(Btree*,int); SQLITE_PRIVATE int sqlite3BtreeSetSafetyLevel(Btree*,int,int,int); SQLITE_PRIVATE int sqlite3BtreeSyncDisabled(Btree*); @@ -8266,11 +8196,11 @@ SQLITE_PRIVATE int sqlite3BtreeGetAutoVacuum(Btree *); SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree*,int); SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree*, const char *zMaster); SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree*, int); SQLITE_PRIVATE int sqlite3BtreeCommit(Btree*); -SQLITE_PRIVATE int sqlite3BtreeRollback(Btree*,int); +SQLITE_PRIVATE int sqlite3BtreeRollback(Btree*); SQLITE_PRIVATE int sqlite3BtreeBeginStmt(Btree*,int); SQLITE_PRIVATE int sqlite3BtreeCreateTable(Btree*, int*, int flags); SQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree*); SQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree*); SQLITE_PRIVATE int sqlite3BtreeIsInBackup(Btree*); @@ -8921,11 +8851,12 @@ ** Allowed values for the flags parameter to sqlite3PagerOpen(). ** ** NOTE: These values must match the corresponding BTREE_ values in btree.h. */ #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ -#define PAGER_MEMORY 0x0002 /* In-memory database */ +#define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */ +#define PAGER_MEMORY 0x0004 /* In-memory database */ /* ** Valid values for the second argument to sqlite3PagerLockingMode(). */ #define PAGER_LOCKINGMODE_QUERY -1 @@ -9006,13 +8937,10 @@ SQLITE_PRIVATE int sqlite3PagerCheckpoint(Pager *pPager, int, int*, int*); SQLITE_PRIVATE int sqlite3PagerWalSupported(Pager *pPager); SQLITE_PRIVATE int sqlite3PagerWalCallback(Pager *pPager); SQLITE_PRIVATE int sqlite3PagerOpenWal(Pager *pPager, int *pisOpen); SQLITE_PRIVATE int sqlite3PagerCloseWal(Pager *pPager); -#ifdef SQLITE_ENABLE_ZIPVFS -SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager); -#endif /* Functions used to query pager state and configuration. */ SQLITE_PRIVATE u8 sqlite3PagerIsreadonly(Pager*); SQLITE_PRIVATE int sqlite3PagerRefcount(Pager*); SQLITE_PRIVATE int sqlite3PagerMemUsed(Pager*); @@ -9081,12 +9009,12 @@ struct PgHdr { sqlite3_pcache_page *pPage; /* Pcache object page handle */ void *pData; /* Page data */ void *pExtra; /* Extra content */ PgHdr *pDirty; /* Transient list of dirty pages */ - Pager *pPager; /* The pager this page is part of */ Pgno pgno; /* Page number for this page */ + Pager *pPager; /* The pager this page is part of */ #ifdef SQLITE_CHECK_PAGES u32 pageHash; /* Hash of page content */ #endif u16 flags; /* PGHDR flags defined below */ @@ -9310,27 +9238,15 @@ # define SQLITE_TEMPNAME_SIZE 200 #endif /* ** Determine if we are dealing with Windows NT. -** -** We ought to be able to determine if we are compiling for win98 or winNT -** using the _WIN32_WINNT macro as follows: -** -** #if defined(_WIN32_WINNT) -** # define SQLITE_OS_WINNT 1 -** #else -** # define SQLITE_OS_WINNT 0 -** #endif -** -** However, vs2005 does not set _WIN32_WINNT by default, as it ought to, -** so the above test does not work. We'll just assume that everything is -** winNT unless the programmer explicitly says otherwise by setting -** SQLITE_OS_WINNT to 0. */ -#if SQLITE_OS_WIN && !defined(SQLITE_OS_WINNT) +#if defined(_WIN32_WINNT) # define SQLITE_OS_WINNT 1 +#else +# define SQLITE_OS_WINNT 0 #endif /* ** Determine if we are dealing with WindowsCE - which has a much ** reduced API. @@ -9724,20 +9640,39 @@ FuncDef *a[23]; /* Hash table for functions */ }; /* ** Each database connection is an instance of the following structure. +** +** The sqlite.lastRowid records the last insert rowid generated by an +** insert statement. Inserts on views do not affect its value. Each +** trigger has its own context, so that lastRowid can be updated inside +** triggers as usual. The previous value will be restored once the trigger +** exits. Upon entering a before or instead of trigger, lastRowid is no +** longer (since after version 2.8.12) reset to -1. +** +** The sqlite.nChange does not count changes within triggers and keeps no +** context. It is reset at start of sqlite3_exec. +** The sqlite.lsChange represents the number of changes made by the last +** insert, update, or delete statement. It remains constant throughout the +** length of a statement and is then updated by OP_SetCounts. It keeps a +** context stack just like lastRowid so that the count of changes +** within a trigger is not seen outside the trigger. Changes to views do not +** affect the value of lsChange. +** The sqlite.csChange keeps track of the number of current changes (since +** the last statement) and is used to update sqlite_lsChange. +** +** The member variables sqlite.errCode, sqlite.zErrMsg and sqlite.zErrMsg16 +** store the most recent error code and, if applicable, string. The +** internal function sqlite3Error() is used to set these variables +** consistently. */ struct sqlite3 { sqlite3_vfs *pVfs; /* OS Interface */ - struct Vdbe *pVdbe; /* List of active virtual machines */ - CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ - sqlite3_mutex *mutex; /* Connection mutex */ + int nDb; /* Number of backends currently in use */ Db *aDb; /* All backends */ - int nDb; /* Number of backends currently in use */ int flags; /* Miscellaneous flags. See below */ - i64 lastRowid; /* ROWID of most recent insert (see above) */ unsigned int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */ int errCode; /* Most recent error code (SQLITE_*) */ int errMask; /* & result codes with this before returning */ u8 autoCommit; /* The auto-commit flag. */ u8 temp_store; /* 1: file 2: memory 0: default */ @@ -9744,27 +9679,31 @@ u8 mallocFailed; /* True if we have seen a malloc failure */ u8 dfltLockMode; /* Default locking-mode for attached dbs */ signed char nextAutovac; /* Autovac setting after VACUUM if >=0 */ u8 suppressErr; /* Do not issue error messages if true */ u8 vtabOnConflict; /* Value to return for s3_vtab_on_conflict() */ - u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */ int nextPagesize; /* Pagesize after VACUUM if >0 */ + int nTable; /* Number of tables in the database */ + CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ + i64 lastRowid; /* ROWID of most recent insert (see above) */ u32 magic; /* Magic number for detect library misuse */ int nChange; /* Value returned by sqlite3_changes() */ int nTotalChange; /* Value returned by sqlite3_total_changes() */ + sqlite3_mutex *mutex; /* Connection mutex */ int aLimit[SQLITE_N_LIMIT]; /* Limits */ struct sqlite3InitInfo { /* Information used during initialization */ + int iDb; /* When back is being initialized */ int newTnum; /* Rootpage of table being initialized */ - u8 iDb; /* Which db file is being initialized */ u8 busy; /* TRUE if currently initializing */ u8 orphanTrigger; /* Last statement is orphaned TEMP trigger */ } init; + int nExtension; /* Number of loaded extensions */ + void **aExtension; /* Array of shared library handles */ + struct Vdbe *pVdbe; /* List of active virtual machines */ int activeVdbeCnt; /* Number of VDBEs currently executing */ int writeVdbeCnt; /* Number of active VDBEs that are writing */ int vdbeExecCnt; /* Number of nested calls to VdbeExec() */ - int nExtension; /* Number of loaded extensions */ - void **aExtension; /* Array of shared library handles */ void (*xTrace)(void*,const char*); /* Trace function */ void *pTraceArg; /* Argument to the trace function */ void (*xProfile)(void*,const char*,u64); /* Profiling function */ void *pProfileArg; /* Argument to profile function */ void *pCommitArg; /* Argument to xCommitCallback() */ @@ -9797,24 +9736,25 @@ int (*xProgress)(void *); /* The progress callback */ void *pProgressArg; /* Argument to the progress callback */ int nProgressOps; /* Number of opcodes for progress callback */ #endif #ifndef SQLITE_OMIT_VIRTUALTABLE - int nVTrans; /* Allocated size of aVTrans */ Hash aModule; /* populated by sqlite3_create_module() */ VtabCtx *pVtabCtx; /* Context for active vtab connect/create */ VTable **aVTrans; /* Virtual tables with open transactions */ + int nVTrans; /* Allocated size of aVTrans */ VTable *pDisconnect; /* Disconnect these in next sqlite3_prepare() */ #endif FuncDefHash aFunc; /* Hash table of connection functions */ Hash aCollSeq; /* All collating sequences */ BusyHandler busyHandler; /* Busy callback */ + int busyTimeout; /* Busy handler timeout, in msec */ Db aDbStatic[2]; /* Static space for the 2 default backends */ Savepoint *pSavepoint; /* List of active savepoints */ - int busyTimeout; /* Busy handler timeout, in msec */ int nSavepoint; /* Number of non-transaction savepoints */ int nStatement; /* Number of nested statement-transactions */ + u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */ i64 nDeferredCons; /* Net deferred constraints this transaction. */ int *pnBytesFreed; /* If not NULL, increment this in DbFree() */ #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY /* The following variables are all protected by the STATIC_MASTER @@ -9853,11 +9793,12 @@ #define SQLITE_NullCallback 0x00002000 /* Invoke the callback once if the */ /* result set is empty */ #define SQLITE_SqlTrace 0x00004000 /* Debug print SQL as it executes */ #define SQLITE_VdbeListing 0x00008000 /* Debug listings of VDBE programs */ #define SQLITE_WriteSchema 0x00010000 /* OK to update SQLITE_MASTER */ - /* 0x00020000 Unused */ +#define SQLITE_NoReadlock 0x00020000 /* Readlocks are omitted when + ** accessing read-only databases */ #define SQLITE_IgnoreChecks 0x00040000 /* Do not enforce check constraints */ #define SQLITE_ReadUncommitted 0x0080000 /* For shared-cache mode */ #define SQLITE_LegacyFileFmt 0x00100000 /* Create new databases in format 1 */ #define SQLITE_FullFSync 0x00200000 /* Use full fsync on the backend */ #define SQLITE_CkptFullFSync 0x00400000 /* Use full fsync for checkpoint */ @@ -9936,22 +9877,19 @@ void (*xDestroy)(void *); void *pUserData; }; /* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. There -** are assert() statements in the code to verify this. +** Possible values for FuncDef.flags */ #define SQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */ #define SQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */ #define SQLITE_FUNC_EPHEM 0x04 /* Ephemeral. Delete with VDBE */ #define SQLITE_FUNC_NEEDCOLL 0x08 /* sqlite3GetFuncCollSeq() might be called */ -#define SQLITE_FUNC_COUNT 0x10 /* Built-in count(*) aggregate */ -#define SQLITE_FUNC_COALESCE 0x20 /* Built-in coalesce() or ifnull() function */ -#define SQLITE_FUNC_LENGTH 0x40 /* Built-in length() function */ -#define SQLITE_FUNC_TYPEOF 0x80 /* Built-in typeof() function */ +#define SQLITE_FUNC_PRIVATE 0x10 /* Allowed for internal use only */ +#define SQLITE_FUNC_COUNT 0x20 /* Built-in count(*) aggregate */ +#define SQLITE_FUNC_COALESCE 0x40 /* Built-in coalesce() or ifnull() function */ /* ** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are ** used to create the initializers for the FuncDef structures. ** @@ -9975,14 +9913,11 @@ ** available as the function user-data (sqlite3_user_data()). The ** FuncDef.flags variable is set to the value passed as the flags ** parameter. */ #define FUNCTION(zName, nArg, iArg, bNC, xFunc) \ - {nArg, SQLITE_UTF8, (bNC*SQLITE_FUNC_NEEDCOLL), \ - SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0} -#define FUNCTION2(zName, nArg, iArg, bNC, xFunc, extraFlags) \ - {nArg, SQLITE_UTF8, (bNC*SQLITE_FUNC_NEEDCOLL)|extraFlags, \ + {nArg, SQLITE_UTF8, bNC*SQLITE_FUNC_NEEDCOLL, \ SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0} #define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \ {nArg, SQLITE_UTF8, bNC*SQLITE_FUNC_NEEDCOLL, \ pArg, 0, xFunc, 0, 0, #zName, 0, 0} #define LIKEFUNC(zName, nArg, arg, flags) \ @@ -10208,11 +10143,11 @@ u8 tabFlags; /* Mask of TF_* values */ u8 keyConf; /* What to do in case of uniqueness conflict on iPKey */ FKey *pFKey; /* Linked list of all foreign keys in this table */ char *zColAff; /* String defining the affinity of each column */ #ifndef SQLITE_OMIT_CHECK - ExprList *pCheck; /* All CHECK constraints */ + Expr *pCheck; /* The AND of all CHECK constraints */ #endif #ifndef SQLITE_OMIT_ALTERTABLE int addColOffset; /* Offset in CREATE TABLE stmt to add a new column */ #endif #ifndef SQLITE_OMIT_VIRTUALTABLE @@ -10231,10 +10166,12 @@ #define TF_Readonly 0x01 /* Read-only system table */ #define TF_Ephemeral 0x02 /* An ephemeral table */ #define TF_HasPrimaryKey 0x04 /* Table has a primary key */ #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */ #define TF_Virtual 0x10 /* Is a virtual table */ +#define TF_NeedMetadata 0x20 /* aCol[].zType and aCol[].pColl missing */ + /* ** Test to see whether or not a table is a virtual table. This is ** done as a macro so that it will be optimized out when virtual @@ -10392,23 +10329,23 @@ ** algorithm to employ whenever an attempt is made to insert a non-unique ** element. */ struct Index { char *zName; /* Name of this index */ + int nColumn; /* Number of columns in the table used by this index */ int *aiColumn; /* Which columns are used by this index. 1st is 0 */ tRowcnt *aiRowEst; /* Result of ANALYZE: Est. rows selected by each column */ Table *pTable; /* The SQL table being indexed */ + int tnum; /* Page containing root of this index in database file */ + u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ + u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */ + u8 bUnordered; /* Use this index for == or IN queries only */ char *zColAff; /* String defining the affinity of each column */ Index *pNext; /* The next index associated with the same table */ Schema *pSchema; /* Schema containing this index */ u8 *aSortOrder; /* Array of size Index.nColumn. True==DESC, False==ASC */ char **azColl; /* Array of collation sequence names for index */ - int nColumn; /* Number of columns in the table used by this index */ - int tnum; /* Page containing root of this index in database file */ - u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ - u8 autoIndex; /* True if is automatically created (ex: by UNIQUE) */ - u8 bUnordered; /* Use this index for == or IN queries only */ #ifdef SQLITE_ENABLE_STAT3 int nSample; /* Number of elements in aSample[] */ tRowcnt avgEq; /* Average nEq value for key values not in aSample */ IndexSample *aSample; /* Samples of the left-most key */ #endif @@ -10463,21 +10400,22 @@ ** from source tables rather than from accumulators */ u8 useSortingIdx; /* In direct mode, reference the sorting index rather ** than the source table */ int sortingIdx; /* Cursor number of the sorting index */ int sortingIdxPTab; /* Cursor number of pseudo-table */ - int nSortingColumn; /* Number of columns in the sorting index */ ExprList *pGroupBy; /* The group by clause */ + int nSortingColumn; /* Number of columns in the sorting index */ struct AggInfo_col { /* For each column used in source tables */ Table *pTab; /* Source table */ int iTable; /* Cursor number of the source table */ int iColumn; /* Column number within the source table */ int iSorterColumn; /* Column number in the sorting index */ int iMem; /* Memory location that acts as accumulator */ Expr *pExpr; /* The original expression */ } *aCol; int nColumn; /* Number of used entries in aCol[] */ + int nColumnAlloc; /* Number of slots allocated for aCol[] */ int nAccumulator; /* Number of columns that show through to the output. ** Additional columns are used only as parameters to ** aggregate functions */ struct AggInfo_func { /* For each aggregate function */ Expr *pExpr; /* Expression encoding the function */ @@ -10484,10 +10422,11 @@ FuncDef *pFunc; /* The aggregate function implementation */ int iMem; /* Memory location that acts as accumulator */ int iDistinct; /* Ephemeral table used to enforce DISTINCT */ } *aFunc; int nFunc; /* Number of entries in aFunc[] */ + int nFuncAlloc; /* Number of slots allocated for aFunc[] */ }; /* ** The datatype ynVar is a signed integer, either 16-bit or 32-bit. ** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater @@ -10601,11 +10540,10 @@ ** TK_VARIABLE: variable number (always >= 1). */ i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */ i16 iRightJoinTable; /* If EP_FromJoin, the right table of the join */ u8 flags2; /* Second set of flags. EP2_... */ u8 op2; /* If a TK_REGISTER, the original value of Expr.op */ - /* If TK_COLUMN, the value of p5 for OP_Column */ AggInfo *pAggInfo; /* Used by TK_AGG_COLUMN and TK_AGG_FUNCTION */ Table *pTab; /* Table for TK_COLUMN expressions. */ #if SQLITE_MAX_EXPR_DEPTH>0 int nHeight; /* Height of the tree headed by this node */ #endif @@ -10624,11 +10562,11 @@ #define EP_InfixFunc 0x0080 /* True for an infix function: LIKE, GLOB, etc */ #define EP_ExpCollate 0x0100 /* Collating sequence specified explicitly */ #define EP_FixedDest 0x0200 /* Result needed in a specific register */ #define EP_IntValue 0x0400 /* Integer value contained in u.iValue */ #define EP_xIsSelect 0x0800 /* x.pSelect is valid (otherwise x.pList is) */ -#define EP_Hint 0x1000 /* Not used */ +#define EP_Hint 0x1000 /* Optimizer hint. Not required for correctness */ #define EP_Reduced 0x2000 /* Expr struct is EXPR_REDUCEDSIZE bytes only */ #define EP_TokenOnly 0x4000 /* Expr struct is EXPR_TOKENONLYSIZE bytes only */ #define EP_Static 0x8000 /* Held in memory not obtained from malloc() */ /* @@ -10681,20 +10619,21 @@ ** also be used as the argument to a function, in which case the a.zName ** field is not used. */ struct ExprList { int nExpr; /* Number of expressions on the list */ + int nAlloc; /* Number of entries allocated below */ int iECursor; /* VDBE Cursor associated with this ExprList */ - struct ExprList_item { /* For each expression in the list */ + struct ExprList_item { Expr *pExpr; /* The list of expressions */ char *zName; /* Token associated with this expression */ char *zSpan; /* Original text of the expression */ u8 sortOrder; /* 1 for DESC or 0 for ASC */ u8 done; /* A flag to indicate when processing is finished */ u16 iOrderByCol; /* For ORDER BY, column number in result set */ u16 iAlias; /* Index into Parse.aAlias[] for zName */ - } *a; /* Alloc a power of two greater or equal to nExpr */ + } *a; /* One entry for each expression */ }; /* ** An instance of this structure is used by the parser to record both ** the parse tree for an expression and the span of input text for an @@ -10725,10 +10664,11 @@ struct IdList_item { char *zName; /* Name of the identifier */ int idx; /* Index in some Table.aCol[] of a column named zName */ } *a; int nId; /* Number of identifiers on the list */ + int nAlloc; /* Number of entries allocated for a[] below */ }; /* ** The bitmask datatype defined below is used for various optimizations. ** @@ -10938,10 +10878,11 @@ int nRef; /* Number of names resolved by this context */ int nErr; /* Number of errors encountered while resolving names */ u8 allowAgg; /* Aggregate functions allowed here */ u8 hasAgg; /* True if aggregates are seen */ u8 isCheck; /* True if resolving names in a CHECK constraint */ + int nDepth; /* Depth of subquery recursion. 1 for no recursion */ AggInfo *pAggInfo; /* Information about aggregates at this level */ NameContext *pNext; /* Next outer name context. NULL for outermost */ }; /* @@ -10967,13 +10908,10 @@ struct Select { ExprList *pEList; /* The fields of the result */ u8 op; /* One of: TK_UNION TK_ALL TK_INTERSECT TK_EXCEPT */ char affinity; /* MakeRecord with this affinity for SRT_Set */ u16 selFlags; /* Various SF_* values */ - int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */ - int addrOpenEphm[3]; /* OP_OpenEphem opcodes related to this select */ - double nSelectRow; /* Estimated number of result rows */ SrcList *pSrc; /* The FROM clause */ Expr *pWhere; /* The WHERE clause */ ExprList *pGroupBy; /* The GROUP BY clause */ Expr *pHaving; /* The HAVING clause */ ExprList *pOrderBy; /* The ORDER BY clause */ @@ -10980,10 +10918,13 @@ Select *pPrior; /* Prior select in a compound select statement */ Select *pNext; /* Next select to the left in a compound */ Select *pRightmost; /* Right-most select in a compound select statement */ Expr *pLimit; /* LIMIT expression. NULL means not used. */ Expr *pOffset; /* OFFSET expression. NULL means not used. */ + int iLimit, iOffset; /* Memory registers holding LIMIT & OFFSET counters */ + int addrOpenEphm[3]; /* OP_OpenEphem opcodes related to this select */ + double nSelectRow; /* Estimated number of result rows */ }; /* ** Allowed values for Select.selFlags. The "SF" prefix stands for ** "Select Flag". @@ -10993,11 +10934,10 @@ #define SF_Aggregate 0x04 /* Contains aggregate functions */ #define SF_UsesEphemeral 0x08 /* Uses the OpenEphemeral opcode */ #define SF_Expanded 0x10 /* sqlite3SelectExpand() called on this */ #define SF_HasTypeInfo 0x20 /* FROM subqueries have Table metadata */ #define SF_UseSorter 0x40 /* Sort using a sorter */ -#define SF_Values 0x80 /* Synthesized from VALUES clause */ /* ** The results of a select can be distributed in several ways. The ** "SRT" prefix means "SELECT Result Type". @@ -11071,14 +11011,14 @@ ** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to ** a mask of new.* columns used by the program. */ struct TriggerPrg { Trigger *pTrigger; /* Trigger this program was coded from */ - TriggerPrg *pNext; /* Next entry in Parse.pTriggerPrg list */ + int orconf; /* Default ON CONFLICT policy */ SubProgram *pProgram; /* Program implementing pTrigger/orconf */ - int orconf; /* Default ON CONFLICT policy */ u32 aColmask[2]; /* Masks of old.*, new.* columns accessed */ + TriggerPrg *pNext; /* Next entry in Parse.pTriggerPrg list */ }; /* ** The yDbMask datatype for the bitmask of all attached databases. */ @@ -11104,22 +11044,18 @@ ** compiled. Function sqlite3TableLock() is used to add entries to the ** list. */ struct Parse { sqlite3 *db; /* The main database structure */ + int rc; /* Return code from execution */ char *zErrMsg; /* An error message */ Vdbe *pVdbe; /* An engine for executing database bytecode */ - int rc; /* Return code from execution */ u8 colNamesSet; /* TRUE after OP_ColumnName has been issued to pVdbe */ u8 checkSchema; /* Causes schema cookie check after an error */ u8 nested; /* Number of nested calls to the parser/code generator */ u8 nTempReg; /* Number of temporary registers in aTempReg[] */ u8 nTempInUse; /* Number of aTempReg[] currently checked out */ - u8 nColCache; /* Number of entries in aColCache[] */ - u8 iColCache; /* Next entry in aColCache[] to replace */ - u8 isMultiWrite; /* True if statement may modify/insert multiple rows */ - u8 mayAbort; /* True if statement may throw an ABORT exception */ int aTempReg[8]; /* Holding area for temporary registers */ int nRangeReg; /* Size of the temporary register block */ int iRangeReg; /* First register in temporary register block */ int nErr; /* Number of errors seen */ int nTab; /* Number of previously allocated VDBE cursors */ @@ -11127,10 +11063,12 @@ int nSet; /* Number of sets used so far */ int nOnce; /* Number of OP_Once instructions so far */ int ckBase; /* Base register of data during check constraints */ int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */ int iCacheCnt; /* Counter used to generate aColCache[].lru values */ + u8 nColCache; /* Number of entries in aColCache[] */ + u8 iColCache; /* Next entry in aColCache[] to replace */ struct yColCache { int iTable; /* Table cursor number */ int iColumn; /* Table column number */ u8 tempReg; /* iReg is a temp register that needs to be freed */ int iLevel; /* Nesting level */ @@ -11137,68 +11075,65 @@ int iReg; /* Reg with value of this column. 0 means none. */ int lru; /* Least recently used entry has the smallest value */ } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */ yDbMask writeMask; /* Start a write transaction on these databases */ yDbMask cookieMask; /* Bitmask of schema verified databases */ + u8 isMultiWrite; /* True if statement may affect/insert multiple rows */ + u8 mayAbort; /* True if statement may throw an ABORT exception */ int cookieGoto; /* Address of OP_Goto to cookie verifier subroutine */ int cookieValue[SQLITE_MAX_ATTACHED+2]; /* Values of cookies to verify */ - int regRowid; /* Register holding rowid of CREATE TABLE entry */ - int regRoot; /* Register holding root page number for new objects */ - int nMaxArg; /* Max args passed to user function by sub-program */ - Token constraintName;/* Name of the constraint currently being parsed */ #ifndef SQLITE_OMIT_SHARED_CACHE int nTableLock; /* Number of locks in aTableLock */ TableLock *aTableLock; /* Required table locks for shared-cache mode */ #endif + int regRowid; /* Register holding rowid of CREATE TABLE entry */ + int regRoot; /* Register holding root page number for new objects */ AutoincInfo *pAinc; /* Information about AUTOINCREMENT counters */ + int nMaxArg; /* Max args passed to user function by sub-program */ /* Information used while coding trigger programs. */ Parse *pToplevel; /* Parse structure for main program (or NULL) */ Table *pTriggerTab; /* Table triggers are being coded for */ - double nQueryLoop; /* Estimated number of iterations of a query */ u32 oldmask; /* Mask of old.* columns referenced */ u32 newmask; /* Mask of new.* columns referenced */ u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */ u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */ u8 disableTriggers; /* True to disable triggers */ + double nQueryLoop; /* Estimated number of iterations of a query */ /* Above is constant between recursions. Below is reset before and after ** each recursion */ - int nVar; /* Number of '?' variables seen in the SQL so far */ - int nzVar; /* Number of available slots in azVar[] */ - u8 explain; /* True if the EXPLAIN flag is found on the query */ -#ifndef SQLITE_OMIT_VIRTUALTABLE - u8 declareVtab; /* True if inside sqlite3_declare_vtab() */ - int nVtabLock; /* Number of virtual tables to lock */ -#endif - int nAlias; /* Number of aliased result set columns */ - int nHeight; /* Expression tree height of current sub-select */ -#ifndef SQLITE_OMIT_EXPLAIN - int iSelectId; /* ID of current select for EXPLAIN output */ - int iNextSelectId; /* Next available select ID for EXPLAIN output */ -#endif - char **azVar; /* Pointers to names of parameters */ - Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */ - int *aAlias; /* Register used to hold aliased result */ - const char *zTail; /* All SQL text past the last semicolon parsed */ - Table *pNewTable; /* A table being constructed by CREATE TABLE */ + int nVar; /* Number of '?' variables seen in the SQL so far */ + int nzVar; /* Number of available slots in azVar[] */ + char **azVar; /* Pointers to names of parameters */ + Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */ + int nAlias; /* Number of aliased result set columns */ + int *aAlias; /* Register used to hold aliased result */ + u8 explain; /* True if the EXPLAIN flag is found on the query */ + Token sNameToken; /* Token with unqualified schema object name */ + Token sLastToken; /* The last token parsed */ + const char *zTail; /* All SQL text past the last semicolon parsed */ + Table *pNewTable; /* A table being constructed by CREATE TABLE */ Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */ const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */ - Token sNameToken; /* Token with unqualified schema object name */ - Token sLastToken; /* The last token parsed */ #ifndef SQLITE_OMIT_VIRTUALTABLE - Token sArg; /* Complete text of a module argument */ - Table **apVtabLock; /* Pointer to virtual tables needing locking */ + Token sArg; /* Complete text of a module argument */ + u8 declareVtab; /* True if inside sqlite3_declare_vtab() */ + int nVtabLock; /* Number of virtual tables to lock */ + Table **apVtabLock; /* Pointer to virtual tables needing locking */ #endif - Table *pZombieTab; /* List of Table objects to delete after code gen */ - TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */ + int nHeight; /* Expression tree height of current sub-select */ + Table *pZombieTab; /* List of Table objects to delete after code gen */ + TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */ + +#ifndef SQLITE_OMIT_EXPLAIN + int iSelectId; + int iNextSelectId; +#endif }; -/* -** Return true if currently inside an sqlite3_declare_vtab() call. -*/ #ifdef SQLITE_OMIT_VIRTUALTABLE #define IN_DECLARE_VTAB 0 #else #define IN_DECLARE_VTAB (pParse->declareVtab) #endif @@ -11211,20 +11146,18 @@ const char *zAuthContext; /* Put saved Parse.zAuthContext here */ Parse *pParse; /* The Parse structure */ }; /* -** Bitfield flags for P5 value in various opcodes. +** Bitfield flags for P5 value in OP_Insert and OP_Delete */ #define OPFLAG_NCHANGE 0x01 /* Set to update db->nChange */ #define OPFLAG_LASTROWID 0x02 /* Set to update db->lastRowid */ #define OPFLAG_ISUPDATE 0x04 /* This OP_Insert is an sql UPDATE */ #define OPFLAG_APPEND 0x08 /* This is likely to be an append */ #define OPFLAG_USESEEKRESULT 0x10 /* Try to avoid a seek in BtreeInsert() */ #define OPFLAG_CLEARCACHE 0x20 /* Clear pseudo-table cache in OP_Column */ -#define OPFLAG_LENGTHARG 0x40 /* OP_Column only used for length() */ -#define OPFLAG_TYPEOFARG 0x80 /* OP_Column only used for typeof() */ /* * Each trigger present in the database schema is stored as an instance of * struct Trigger. * @@ -11347,12 +11280,12 @@ ** A pointer to this structure is used to communicate information ** from sqlite3Init and OP_ParseSchema into the sqlite3InitCallback. */ typedef struct { sqlite3 *db; /* The database being initialized */ - char **pzErrMsg; /* Error message stored here */ int iDb; /* 0 for main database. 1 for TEMP, 2.. for ATTACHed */ + char **pzErrMsg; /* Error message stored here */ int rc; /* Result code stored here */ } InitData; /* ** Structure containing global configuration data for the SQLite library. @@ -11403,11 +11336,10 @@ int (*xSelectCallback)(Walker*,Select*); /* Callback for SELECTs */ Parse *pParse; /* Parser context. */ union { /* Extra data for callback */ NameContext *pNC; /* Naming context */ int i; /* Integer value */ - SrcList *pSrcList; /* FROM clause */ } u; }; /* Forward declarations */ SQLITE_PRIVATE int sqlite3WalkExpr(Walker*, Expr*); @@ -11491,11 +11423,11 @@ #endif /* ** Internal function prototypes */ -#define sqlite3StrICmp sqlite3_stricmp +SQLITE_PRIVATE int sqlite3StrICmp(const char *, const char *); SQLITE_PRIVATE int sqlite3Strlen30(const char*); #define sqlite3StrNICmp sqlite3_strnicmp SQLITE_PRIVATE int sqlite3MallocInit(void); SQLITE_PRIVATE void sqlite3MallocEnd(void); @@ -11639,11 +11571,10 @@ SQLITE_PRIVATE void sqlite3AddDefaultValue(Parse*,ExprSpan*); SQLITE_PRIVATE void sqlite3AddCollateType(Parse*, Token*); SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,Select*); SQLITE_PRIVATE int sqlite3ParseUri(const char*,const char*,unsigned int*, sqlite3_vfs**,char**,char **); -SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3*,const char*); SQLITE_PRIVATE int sqlite3CodeOnce(Parse *); SQLITE_PRIVATE Bitvec *sqlite3BitvecCreate(u32); SQLITE_PRIVATE int sqlite3BitvecTest(Bitvec*, u32); SQLITE_PRIVATE int sqlite3BitvecSet(Bitvec*, u32); @@ -11675,11 +11606,11 @@ #else # define sqlite3AutoincrementBegin(X) # define sqlite3AutoincrementEnd(X) #endif SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int); -SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*); +SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int,int*,int*,int*); SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*); SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*); SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int); SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*); SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*, @@ -11705,11 +11636,11 @@ #endif SQLITE_PRIVATE void sqlite3DeleteFrom(Parse*, SrcList*, Expr*); SQLITE_PRIVATE void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int); SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**,ExprList*,u16); SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo*); -SQLITE_PRIVATE int sqlite3ExprCodeGetColumn(Parse*, Table*, int, int, int, u8); +SQLITE_PRIVATE int sqlite3ExprCodeGetColumn(Parse*, Table*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCodeGetColumnOfTable(Vdbe*, Table*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCodeMove(Parse*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCacheStore(Parse*, int, int, int); SQLITE_PRIVATE void sqlite3ExprCachePush(Parse*); @@ -11739,11 +11670,11 @@ SQLITE_PRIVATE void sqlite3ExprAnalyzeAggList(NameContext*,ExprList*); SQLITE_PRIVATE Vdbe *sqlite3GetVdbe(Parse*); SQLITE_PRIVATE void sqlite3PrngSaveState(void); SQLITE_PRIVATE void sqlite3PrngRestoreState(void); SQLITE_PRIVATE void sqlite3PrngResetState(void); -SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*,int); +SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3*); SQLITE_PRIVATE void sqlite3CodeVerifySchema(Parse*, int); SQLITE_PRIVATE void sqlite3CodeVerifyNamedSchema(Parse*, const char *zDb); SQLITE_PRIVATE void sqlite3BeginTransaction(Parse*, int); SQLITE_PRIVATE void sqlite3CommitTransaction(Parse*); SQLITE_PRIVATE void sqlite3RollbackTransaction(Parse*); @@ -11772,11 +11703,11 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3*,ExprList*,int); SQLITE_PRIVATE SrcList *sqlite3SrcListDup(sqlite3*,SrcList*,int); SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3*,IdList*); SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3*,Select*,int); SQLITE_PRIVATE void sqlite3FuncDefInsert(FuncDefHash*, FuncDef*); -SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,u8); +SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int); SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(sqlite3*); SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void); SQLITE_PRIVATE void sqlite3RegisterGlobalFunctions(void); SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3*); SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3*); @@ -11913,11 +11844,11 @@ #ifdef SQLITE_ENABLE_8_3_NAMES SQLITE_PRIVATE void sqlite3FileSuffix3(const char*, char*); #else # define sqlite3FileSuffix3(X,Y) #endif -SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z,int); +SQLITE_PRIVATE u8 sqlite3GetBoolean(const char *z); SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value*, u8); SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value*, u8); SQLITE_PRIVATE void sqlite3ValueSetStr(sqlite3_value*, int, const void *,u8, void(*)(void*)); @@ -12039,11 +11970,11 @@ SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *, int, int); SQLITE_PRIVATE VTable *sqlite3GetVTable(sqlite3*, Table*); # define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0) #endif SQLITE_PRIVATE void sqlite3VtabMakeWritable(Parse*,Table*); -SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*, int); +SQLITE_PRIVATE void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*); SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse*, Token*); SQLITE_PRIVATE void sqlite3VtabArgInit(Parse*); SQLITE_PRIVATE void sqlite3VtabArgExtend(Parse*, Token*); SQLITE_PRIVATE int sqlite3VtabCallCreate(sqlite3*, int, const char *, char **); SQLITE_PRIVATE int sqlite3VtabCallConnect(Parse*, Table*); @@ -12968,25 +12899,25 @@ ** set to NULL if the currently executing frame is the main program. */ typedef struct VdbeFrame VdbeFrame; struct VdbeFrame { Vdbe *v; /* VM this frame belongs to */ - VdbeFrame *pParent; /* Parent of this frame, or NULL if parent is main */ + int pc; /* Program Counter in parent (calling) frame */ Op *aOp; /* Program instructions for parent frame */ + int nOp; /* Size of aOp array */ Mem *aMem; /* Array of memory cells for parent frame */ + int nMem; /* Number of entries in aMem */ u8 *aOnceFlag; /* Array of OP_Once flags for parent frame */ + int nOnceFlag; /* Number of entries in aOnceFlag */ VdbeCursor **apCsr; /* Array of Vdbe cursors for parent frame */ - void *token; /* Copy of SubProgram.token */ - i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ u16 nCursor; /* Number of entries in apCsr */ - int pc; /* Program Counter in parent (calling) frame */ - int nOp; /* Size of aOp array */ - int nMem; /* Number of entries in aMem */ - int nOnceFlag; /* Number of entries in aOnceFlag */ + void *token; /* Copy of SubProgram.token */ int nChildMem; /* Number of memory cells for child frame */ int nChildCsr; /* Number of cursors for child frame */ + i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ int nChange; /* Statement changes (Vdbe.nChanges) */ + VdbeFrame *pParent; /* Parent of this frame, or NULL if parent is main */ }; #define VdbeFrameMem(p) ((Mem *)&((u8 *)p)[ROUND8(sizeof(VdbeFrame))]) /* @@ -13109,13 +13040,12 @@ struct sqlite3_context { FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */ VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */ Mem s; /* The return value is stored here */ Mem *pMem; /* Memory cell used to store aggregate context */ - CollSeq *pColl; /* Collating sequence */ int isError; /* Error code returned by the function. */ - int skipFlag; /* Skip skip accumulator loading if true */ + CollSeq *pColl; /* Collating sequence */ }; /* ** An Explain object accumulates indented output which is helpful ** in describing recursive data structures. @@ -13152,10 +13082,11 @@ Mem *pResultSet; /* Pointer to an array of results */ int nMem; /* Number of memory locations currently allocated */ int nOp; /* Number of instructions in the program */ int nOpAlloc; /* Number of slots allocated for aOp[] */ int nLabel; /* Number of labels used */ + int nLabelAlloc; /* Number of slots allocated in aLabel[] */ int *aLabel; /* Space to hold the labels */ u16 nResColumn; /* Number of columns in one row of the result set */ u16 nCursor; /* Number of slots in apCsr[] */ u32 magic; /* Magic number for sanity checking */ char *zErrMsg; /* Error message written here */ @@ -13537,16 +13468,14 @@ ** Set *pCurrent to the total cache hits or misses encountered by all ** pagers the database handle is connected to. *pHighwater is always set ** to zero. */ case SQLITE_DBSTATUS_CACHE_HIT: - case SQLITE_DBSTATUS_CACHE_MISS: - case SQLITE_DBSTATUS_CACHE_WRITE:{ + case SQLITE_DBSTATUS_CACHE_MISS: { int i; int nRet = 0; assert( SQLITE_DBSTATUS_CACHE_MISS==SQLITE_DBSTATUS_CACHE_HIT+1 ); - assert( SQLITE_DBSTATUS_CACHE_WRITE==SQLITE_DBSTATUS_CACHE_HIT+2 ); for(i=0; inDb; i++){ if( db->aDb[i].pBt ){ Pager *pPager = sqlite3BtreePager(db->aDb[i].pBt); sqlite3PagerCacheStat(pPager, op, resetFlag, &nRet); @@ -15220,35 +15149,11 @@ ** This file contains low-level memory allocation drivers for when ** SQLite will use the standard C-library malloc/realloc/free interface ** to obtain the memory it needs. ** ** This file contains implementations of the low-level memory allocation -** routines specified in the sqlite3_mem_methods object. The content of -** this file is only used if SQLITE_SYSTEM_MALLOC is defined. The -** SQLITE_SYSTEM_MALLOC macro is defined automatically if neither the -** SQLITE_MEMDEBUG nor the SQLITE_WIN32_MALLOC macros are defined. The -** default configuration is to use memory allocation routines in this -** file. -** -** C-preprocessor macro summary: -** -** HAVE_MALLOC_USABLE_SIZE The configure script sets this symbol if -** the malloc_usable_size() interface exists -** on the target platform. Or, this symbol -** can be set manually, if desired. -** If an equivalent interface exists by -** a different name, using a separate -D -** option to rename it. -** -** SQLITE_WITHOUT_ZONEMALLOC Some older macs lack support for the zone -** memory allocator. Set this symbol to enable -** building on older macs. -** -** SQLITE_WITHOUT_MSIZE Set this symbol to disable the use of -** _msize() on windows systems. This might -** be necessary when compiling for Delphi, -** for example. +** routines specified in the sqlite3_mem_methods object. */ /* ** This version of the memory allocator is the default. It is ** used when no other memory allocator is specified using compile-time @@ -15255,23 +15160,21 @@ ** macros. */ #ifdef SQLITE_SYSTEM_MALLOC /* -** The MSVCRT has malloc_usable_size() but it is called _msize(). -** The use of _msize() is automatic, but can be disabled by compiling -** with -DSQLITE_WITHOUT_MSIZE +** Windows systems have malloc_usable_size() but it is called _msize() */ -#if defined(_MSC_VER) && !defined(SQLITE_WITHOUT_MSIZE) -# define SQLITE_MALLOCSIZE _msize +#if !defined(HAVE_MALLOC_USABLE_SIZE) && SQLITE_OS_WIN +# define HAVE_MALLOC_USABLE_SIZE 1 +# define malloc_usable_size _msize #endif -#if defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC) +#if defined(__APPLE__) /* -** Use the zone allocator available on apple products unless the -** SQLITE_WITHOUT_ZONEMALLOC symbol is defined. +** Use the zone allocator available on apple products */ #include #include #include static malloc_zone_t* _sqliteZone_; @@ -15282,27 +15185,21 @@ (_sqliteZone_ ? _sqliteZone_->size(_sqliteZone_,x) : malloc_size(x)) #else /* if not __APPLE__ */ /* -** Use standard C library malloc and free on non-Apple systems. -** Also used by Apple systems if SQLITE_WITHOUT_ZONEMALLOC is defined. +** Use standard C library malloc and free on non-Apple systems. */ #define SQLITE_MALLOC(x) malloc(x) #define SQLITE_FREE(x) free(x) #define SQLITE_REALLOC(x,y) realloc((x),(y)) -#if (defined(_MSC_VER) && !defined(SQLITE_WITHOUT_MSIZE)) \ - || (defined(HAVE_MALLOC_H) && defined(HAVE_MALLOC_USABLE_SIZE)) -# include /* Needed for malloc_usable_size on linux */ -#endif #ifdef HAVE_MALLOC_USABLE_SIZE -# ifndef SQLITE_MALLOCSIZE -# define SQLITE_MALLOCSIZE(x) malloc_usable_size(x) -# endif +#include +#define SQLITE_MALLOCSIZE(x) malloc_usable_size(x) #else -# undef SQLITE_MALLOCSIZE +#undef SQLITE_MALLOCSIZE #endif #endif /* __APPLE__ or not __APPLE__ */ /* @@ -15420,11 +15317,11 @@ /* ** Initialize this module. */ static int sqlite3MemInit(void *NotUsed){ -#if defined(__APPLE__) && !defined(SQLITE_WITHOUT_ZONEMALLOC) +#if defined(__APPLE__) int cpuCount; size_t len; if( _sqliteZone_ ){ return SQLITE_OK; } @@ -21289,17 +21186,17 @@ /* ** Some systems have stricmp(). Others have strcasecmp(). Because ** there is no consistency, we will define our own. ** -** IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and -** sqlite3_strnicmp() APIs allow applications and extensions to compare -** the contents of two buffers containing UTF-8 strings in a -** case-independent fashion, using the same definition of "case -** independence" that SQLite uses internally when comparing identifiers. +** IMPLEMENTATION-OF: R-20522-24639 The sqlite3_strnicmp() API allows +** applications and extensions to compare the contents of two buffers +** containing UTF-8 strings in a case-independent fashion, using the same +** definition of case independence that SQLite uses internally when +** comparing identifiers. */ -SQLITE_API int sqlite3_stricmp(const char *zLeft, const char *zRight){ +SQLITE_PRIVATE int sqlite3StrICmp(const char *zLeft, const char *zRight){ register unsigned char *a, *b; a = (unsigned char *)zLeft; b = (unsigned char *)zRight; while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } return UpperToLower[*a] - UpperToLower[*b]; @@ -25000,12 +24897,12 @@ #ifndef SQLITE_DEFAULT_FILE_PERMISSIONS # define SQLITE_DEFAULT_FILE_PERMISSIONS 0644 #endif /* -** Default permissions when creating auto proxy dir -*/ + ** Default permissions when creating auto proxy dir + */ #ifndef SQLITE_DEFAULT_PROXYDIR_PERMISSIONS # define SQLITE_DEFAULT_PROXYDIR_PERMISSIONS 0755 #endif /* @@ -25046,11 +24943,11 @@ sqlite3_io_methods const *pMethod; /* Always the first entry */ sqlite3_vfs *pVfs; /* The VFS that created this unixFile */ unixInodeInfo *pInode; /* Info about locks on this inode */ int h; /* The file descriptor */ unsigned char eFileLock; /* The type of lock held on this fd */ - unsigned short int ctrlFlags; /* Behavioral bits. UNIXFILE_* flags */ + unsigned char ctrlFlags; /* Behavioral bits. UNIXFILE_* flags */ int lastErrno; /* The unix errno from last I/O error */ void *lockingContext; /* Locking style specific state */ UnixUnusedFd *pUnused; /* Pre-allocated UnixUnusedFd */ const char *zPath; /* Name of the file */ unixShm *pShm; /* Shared memory segment information */ @@ -25097,11 +24994,10 @@ #endif #define UNIXFILE_PSOW 0x10 /* SQLITE_IOCAP_POWERSAFE_OVERWRITE */ #define UNIXFILE_DELETE 0x20 /* Delete on close */ #define UNIXFILE_URI 0x40 /* Filename might have query parameters */ #define UNIXFILE_NOLOCK 0x80 /* Do no file locking */ -#define UNIXFILE_CHOWN 0x100 /* File ownership was changed */ /* ** Include code that is common to all os_*.c files */ /************** Include os_common.h in the middle of os_unix.c ***************/ @@ -25462,16 +25358,10 @@ #define osMkdir ((int(*)(const char*,mode_t))aSyscall[18].pCurrent) { "rmdir", (sqlite3_syscall_ptr)rmdir, 0 }, #define osRmdir ((int(*)(const char*))aSyscall[19].pCurrent) - { "fchown", (sqlite3_syscall_ptr)fchown, 0 }, -#define osFchown ((int(*)(int,uid_t,gid_t))aSyscall[20].pCurrent) - - { "umask", (sqlite3_syscall_ptr)umask, 0 }, -#define osUmask ((mode_t(*)(mode_t))aSyscall[21].pCurrent) - }; /* End of the overrideable system calls */ /* ** This is the xSetSystemCall() method of sqlite3_vfs for all of the ** "unix" VFSes. Return SQLITE_OK opon successfully updating the @@ -25554,50 +25444,16 @@ } return 0; } /* -** Invoke open(). Do so multiple times, until it either succeeds or -** fails for some reason other than EINTR. -** -** If the file creation mode "m" is 0 then set it to the default for -** SQLite. The default is SQLITE_DEFAULT_FILE_PERMISSIONS (normally -** 0644) as modified by the system umask. If m is not 0, then -** make the file creation mode be exactly m ignoring the umask. -** -** The m parameter will be non-zero only when creating -wal, -journal, -** and -shm files. We want those files to have *exactly* the same -** permissions as their original database, unadulterated by the umask. -** In that way, if a database file is -rw-rw-rw or -rw-rw-r-, and a -** transaction crashes and leaves behind hot journals, then any -** process that is able to write to the database will also be able to -** recover the hot journals. +** Retry open() calls that fail due to EINTR */ -static int robust_open(const char *z, int f, mode_t m){ - int fd; - mode_t m2; - mode_t origM = 0; - if( m==0 ){ - m2 = SQLITE_DEFAULT_FILE_PERMISSIONS; - }else{ - m2 = m; - origM = osUmask(0); - } - do{ -#if defined(O_CLOEXEC) - fd = osOpen(z,f|O_CLOEXEC,m2); -#else - fd = osOpen(z,f,m2); -#endif - }while( fd<0 && errno==EINTR ); - if( m ){ - osUmask(origM); - } -#if defined(FD_CLOEXEC) && (!defined(O_CLOEXEC) || O_CLOEXEC==0) - if( fd>=0 ) osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC); -#endif - return fd; +static int robust_open(const char *z, int f, int m){ + int rc; + do{ rc = osOpen(z,f,m); }while( rc<0 && errno==EINTR ); + return rc; } /* ** Helper functions to obtain and relinquish the global mutex. The ** global mutex is used to protect the unixInodeInfo and @@ -28388,10 +28244,13 @@ for(ii=(int)strlen(zDirname); ii>1 && zDirname[ii]!='/'; ii--); if( ii>0 ){ zDirname[ii] = '\0'; fd = robust_open(zDirname, O_RDONLY|O_BINARY, 0); if( fd>=0 ){ +#ifdef FD_CLOEXEC + osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC); +#endif OSTRACE(("OPENDIR %-3d %s\n", fd, zDirname)); } } *pFd = fd; return (fd>=0?SQLITE_OK:unixLogError(SQLITE_CANTOPEN_BKPT, "open", zDirname)); @@ -28470,11 +28329,11 @@ /* If the user has configured a chunk-size for this file, truncate the ** file so that it consists of an integer number of chunks (i.e. the ** actual file size after the operation may be larger than the requested ** size). */ - if( pFile->szChunk>0 ){ + if( pFile->szChunk ){ nByte = ((nByte + pFile->szChunk - 1)/pFile->szChunk) * pFile->szChunk; } rc = robust_ftruncate(pFile->h, (off_t)nByte); if( rc ){ @@ -28937,11 +28796,12 @@ if( pShmNode==0 ){ struct stat sStat; /* fstat() info for database file */ /* Call fstat() to figure out the permissions on the database file. If ** a new *-shm file is created, an attempt will be made to create it - ** with the same permissions. + ** with the same permissions. The actual permissions the file is created + ** with are subject to the current umask setting. */ if( osFstat(pDbFd->h, &sStat) && pInode->bProcessLock==0 ){ rc = SQLITE_IOERR_FSTAT; goto shm_open_err; } @@ -28981,23 +28841,14 @@ openFlags = O_RDONLY; pShmNode->isReadonly = 1; } pShmNode->h = robust_open(zShmFilename, openFlags, (sStat.st_mode&0777)); if( pShmNode->h<0 ){ - rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zShmFilename); - goto shm_open_err; - } - - /* If this process is running as root, make sure that the SHM file - ** is owned by the same user that owns the original database. Otherwise, - ** the original owner will not be able to connect. If this process is - ** not root, the following fchown() will fail, but we don't care. The - ** if(){..} and the UNIXFILE_CHOWN flag are purely to silence compiler - ** warnings. - */ - if( osFchown(pShmNode->h, sStat.st_uid, sStat.st_gid)==0 ){ - pDbFd->ctrlFlags |= UNIXFILE_CHOWN; + if( pShmNode->h<0 ){ + rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zShmFilename); + goto shm_open_err; + } } /* Check to see if another process is holding the dead-man switch. ** If not, truncate the file to zero length. */ @@ -29968,14 +29819,16 @@ ** to create new files with. If no error occurs, then SQLITE_OK is returned ** and a value suitable for passing as the third argument to open(2) is ** written to *pMode. If an IO error occurs, an SQLite error code is ** returned and the value of *pMode is not modified. ** -** In most cases cases, this routine sets *pMode to 0, which will become -** an indication to robust_open() to create the file using -** SQLITE_DEFAULT_FILE_PERMISSIONS adjusted by the umask. -** But if the file being opened is a WAL or regular journal file, then +** If the file being opened is a temporary file, it is always created with +** the octal permissions 0600 (read/writable by owner only). If the file +** is a database or master journal file, it is created with the permissions +** mask SQLITE_DEFAULT_FILE_PERMISSIONS. +** +** Finally, if the file being opened is a WAL or regular journal file, then ** this function queries the file-system for the permissions on the ** corresponding database file and sets *pMode to this value. Whenever ** possible, WAL and journal files are created using the same permissions ** as the associated database file. ** @@ -29985,18 +29838,14 @@ ** the default permissions. */ static int findCreateFileMode( const char *zPath, /* Path of file (possibly) being created */ int flags, /* Flags passed as 4th argument to xOpen() */ - mode_t *pMode, /* OUT: Permissions to open file with */ - uid_t *pUid, /* OUT: uid to set on the file */ - gid_t *pGid /* OUT: gid to set on the file */ + mode_t *pMode /* OUT: Permissions to open file with */ ){ int rc = SQLITE_OK; /* Return Code */ - *pMode = 0; - *pUid = 0; - *pGid = 0; + *pMode = SQLITE_DEFAULT_FILE_PERMISSIONS; if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){ char zDb[MAX_PATHNAME+1]; /* Database file path */ int nDb; /* Number of valid bytes in zDb */ struct stat sStat; /* Output of stat() on database file */ @@ -30026,12 +29875,10 @@ memcpy(zDb, zPath, nDb); zDb[nDb] = '\0'; if( 0==osStat(zDb, &sStat) ){ *pMode = sStat.st_mode & 0777; - *pUid = sStat.st_uid; - *pGid = sStat.st_gid; }else{ rc = SQLITE_IOERR_FSTAT; } }else if( flags & SQLITE_OPEN_DELETEONCLOSE ){ *pMode = 0600; @@ -30174,13 +30021,11 @@ if( isExclusive ) openFlags |= (O_EXCL|O_NOFOLLOW); openFlags |= (O_LARGEFILE|O_BINARY); if( fd<0 ){ mode_t openMode; /* Permissions to create file with */ - uid_t uid; /* Userid for the file */ - gid_t gid; /* Groupid for the file */ - rc = findCreateFileMode(zName, flags, &openMode, &uid, &gid); + rc = findCreateFileMode(zName, flags, &openMode); if( rc!=SQLITE_OK ){ assert( !p->pUnused ); assert( eType==SQLITE_OPEN_WAL || eType==SQLITE_OPEN_MAIN_JOURNAL ); return rc; } @@ -30197,21 +30042,10 @@ } if( fd<0 ){ rc = unixLogError(SQLITE_CANTOPEN_BKPT, "open", zName); goto open_finished; } - - /* If this process is running as root and if creating a new rollback - ** journal or WAL file, set the ownership of the journal or WAL to be - ** the same as the original database. If we are not running as root, - ** then the fchown() call will fail, but that's ok. The "if(){}" and - ** the setting of the UNIXFILE_CHOWN flag are purely to silence compiler - ** warnings from gcc. - */ - if( flags & (SQLITE_OPEN_WAL|SQLITE_OPEN_MAIN_JOURNAL) ){ - if( osFchown(fd, uid, gid)==0 ){ p->ctrlFlags |= UNIXFILE_CHOWN; } - } } assert( fd>=0 ); if( pOutFlags ){ *pOutFlags = flags; } @@ -30231,10 +30065,14 @@ #if SQLITE_ENABLE_LOCKING_STYLE else{ p->openFlags = openFlags; } #endif + +#ifdef FD_CLOEXEC + osFcntl(fd, F_SETFD, osFcntl(fd, F_GETFD, 0) | FD_CLOEXEC); +#endif noLock = eType!=SQLITE_OPEN_MAIN_DB; #if defined(__APPLE__) || SQLITE_ENABLE_LOCKING_STYLE @@ -30515,11 +30353,11 @@ ** tests repeatable. */ memset(zBuf, 0, nBuf); #if !defined(SQLITE_TEST) { - int pid, fd, got; + int pid, fd; fd = robust_open("/dev/urandom", O_RDONLY, 0); if( fd<0 ){ time_t t; time(&t); memcpy(zBuf, &t, sizeof(t)); @@ -30526,11 +30364,11 @@ pid = getpid(); memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid)); assert( sizeof(t)+sizeof(pid)<=(size_t)nBuf ); nBuf = sizeof(t) + sizeof(pid); }else{ - do{ got = osRead(fd, zBuf, nBuf); }while( got<0 && errno==EINTR ); + do{ nBuf = osRead(fd, zBuf, nBuf); }while( nBuf<0 && errno==EINTR ); robust_close(0, fd, __LINE__); } } #endif return nBuf; @@ -30930,21 +30768,21 @@ if( !pUnused ){ return SQLITE_NOMEM; } } if( fd<0 ){ - fd = robust_open(path, openFlags, 0); + fd = robust_open(path, openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); terrno = errno; if( fd<0 && errno==ENOENT && islockfile ){ if( proxyCreateLockPath(path) == SQLITE_OK ){ - fd = robust_open(path, openFlags, 0); + fd = robust_open(path, openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); } } } if( fd<0 ){ openFlags = O_RDONLY; - fd = robust_open(path, openFlags, 0); + fd = robust_open(path, openFlags, SQLITE_DEFAULT_FILE_PERMISSIONS); terrno = errno; } if( fd<0 ){ if( islockfile ){ return SQLITE_BUSY; @@ -31064,11 +30902,12 @@ if( readLenh>=0 ){ robust_close(pFile, pFile->h, __LINE__); } pFile->h = -1; - fd = robust_open(pCtx->dbPath, pFile->openFlags, 0); + fd = robust_open(pCtx->dbPath, pFile->openFlags, + SQLITE_DEFAULT_FILE_PERMISSIONS); OSTRACE(("TRANSPROXY: OPEN %d\n", fd)); if( fd>=0 ){ pFile->h = fd; }else{ rc=SQLITE_CANTOPEN_BKPT; /* SQLITE_BUSY? proxyTakeConch called @@ -31910,11 +31750,11 @@ }; unsigned int i; /* Loop counter */ /* Double-check that the aSyscall[] array has been constructed ** correctly. See ticket [bb3a86e890c8e96ab] */ - assert( ArraySize(aSyscall)==22 ); + assert( ArraySize(aSyscall)==20 ); /* Register all VFSes defined in the aVfs[] array */ for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){ sqlite3_vfs_register(&aVfs[i], i==0); } @@ -33759,13 +33599,10 @@ } sqlite3_free(pFile->zDeleteOnClose); } #endif OSTRACE(("CLOSE %d %s\n", pFile->h, rc ? "ok" : "failed")); - if( rc ){ - pFile->h = NULL; - } OpenCounter(-1); return rc ? SQLITE_OK : winLogError(SQLITE_IOERR_CLOSE, osGetLastError(), "winClose", pFile->zPath); } @@ -33779,33 +33616,22 @@ sqlite3_file *id, /* File to read from */ void *pBuf, /* Write content into this buffer */ int amt, /* Number of bytes to read */ sqlite3_int64 offset /* Begin reading at this offset */ ){ -#if !SQLITE_OS_WINCE - OVERLAPPED overlapped; /* The offset for ReadFile. */ -#endif winFile *pFile = (winFile*)id; /* file handle */ DWORD nRead; /* Number of bytes actually read from file */ int nRetry = 0; /* Number of retrys */ assert( id!=0 ); SimulateIOError(return SQLITE_IOERR_READ); OSTRACE(("READ %d lock=%d\n", pFile->h, pFile->locktype)); -#if SQLITE_OS_WINCE if( seekWinFile(pFile, offset) ){ return SQLITE_FULL; } while( !osReadFile(pFile->h, pBuf, amt, &nRead, 0) ){ -#else - memset(&overlapped, 0, sizeof(OVERLAPPED)); - overlapped.Offset = (LONG)(offset & 0xffffffff); - overlapped.OffsetHigh = (LONG)((offset>>32) & 0x7fffffff); - while( !osReadFile(pFile->h, pBuf, amt, &nRead, &overlapped) && - osGetLastError()!=ERROR_HANDLE_EOF ){ -#endif DWORD lastErrno; if( retryIoerr(&nRetry, &lastErrno) ) continue; pFile->lastErrno = lastErrno; return winLogError(SQLITE_IOERR_READ, pFile->lastErrno, "winRead", pFile->zPath); @@ -33828,11 +33654,11 @@ sqlite3_file *id, /* File to write into */ const void *pBuf, /* The bytes to be written */ int amt, /* Number of bytes to write */ sqlite3_int64 offset /* Offset into the file to begin writing at */ ){ - int rc = 0; /* True if error has occured, else false */ + int rc; /* True if error has occured, else false */ winFile *pFile = (winFile*)id; /* File handle */ int nRetry = 0; /* Number of retries */ assert( amt>0 ); assert( pFile ); @@ -33839,48 +33665,23 @@ SimulateIOError(return SQLITE_IOERR_WRITE); SimulateDiskfullError(return SQLITE_FULL); OSTRACE(("WRITE %d lock=%d\n", pFile->h, pFile->locktype)); -#if SQLITE_OS_WINCE rc = seekWinFile(pFile, offset); if( rc==0 ){ -#else - { -#endif -#if !SQLITE_OS_WINCE - OVERLAPPED overlapped; /* The offset for WriteFile. */ -#endif u8 *aRem = (u8 *)pBuf; /* Data yet to be written */ int nRem = amt; /* Number of bytes yet to be written */ DWORD nWrite; /* Bytes written by each WriteFile() call */ DWORD lastErrno = NO_ERROR; /* Value returned by GetLastError() */ -#if !SQLITE_OS_WINCE - memset(&overlapped, 0, sizeof(OVERLAPPED)); - overlapped.Offset = (LONG)(offset & 0xffffffff); - overlapped.OffsetHigh = (LONG)((offset>>32) & 0x7fffffff); -#endif - while( nRem>0 ){ -#if SQLITE_OS_WINCE if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, 0) ){ -#else - if( !osWriteFile(pFile->h, aRem, nRem, &nWrite, &overlapped) ){ -#endif if( retryIoerr(&nRetry, &lastErrno) ) continue; break; } - if( nWrite<=0 ){ - lastErrno = osGetLastError(); - break; - } -#if !SQLITE_OS_WINCE - offset += nWrite; - overlapped.Offset = (LONG)(offset & 0xffffffff); - overlapped.OffsetHigh = (LONG)((offset>>32) & 0x7fffffff); -#endif + if( nWrite<=0 ) break; aRem += nWrite; nRem -= nWrite; } if( nRem>0 ){ pFile->lastErrno = lastErrno; @@ -35174,39 +34975,10 @@ OSTRACE(("TEMP FILENAME: %s\n", zBuf)); return SQLITE_OK; } -/* -** Return TRUE if the named file is really a directory. Return false if -** it is something other than a directory, or if there is any kind of memory -** allocation failure. -*/ -static int winIsDir(const void *zConverted){ - DWORD attr; - int rc = 0; - DWORD lastErrno; - - if( isNT() ){ - int cnt = 0; - WIN32_FILE_ATTRIBUTE_DATA sAttrData; - memset(&sAttrData, 0, sizeof(sAttrData)); - while( !(rc = osGetFileAttributesExW((LPCWSTR)zConverted, - GetFileExInfoStandard, - &sAttrData)) && retryIoerr(&cnt, &lastErrno) ){} - if( !rc ){ - return 0; /* Invalid name? */ - } - attr = sAttrData.dwFileAttributes; -#if SQLITE_OS_WINCE==0 - }else{ - attr = osGetFileAttributesA((char*)zConverted); -#endif - } - return (attr!=INVALID_FILE_ATTRIBUTES) && (attr&FILE_ATTRIBUTE_DIRECTORY); -} - /* ** Open a file. */ static int winOpen( sqlite3_vfs *pVfs, /* Not used */ @@ -35309,15 +35081,10 @@ zConverted = convertUtf8Filename(zUtf8Name); if( zConverted==0 ){ return SQLITE_IOERR_NOMEM; } - if( winIsDir(zConverted) ){ - sqlite3_free(zConverted); - return SQLITE_CANTOPEN_ISDIR; - } - if( isReadWrite ){ dwDesiredAccess = GENERIC_READ | GENERIC_WRITE; }else{ dwDesiredAccess = GENERIC_READ; } @@ -35363,24 +35130,24 @@ dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL))==INVALID_HANDLE_VALUE && - retryIoerr(&cnt, &lastErrno) ){ - /* Noop */ - } + retryIoerr(&cnt, &lastErrno) ){} +/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. +** Since the ANSI version of these Windows API do not exist for WINCE, +** it's important to not reference them for WINCE builds. +*/ #if SQLITE_OS_WINCE==0 }else{ while( (h = osCreateFileA((LPCSTR)zConverted, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL))==INVALID_HANDLE_VALUE && - retryIoerr(&cnt, &lastErrno) ){ - /* Noop */ - } + retryIoerr(&cnt, &lastErrno) ){} #endif } logIoerr(cnt); @@ -35456,11 +35223,10 @@ const char *zFilename, /* Name of file to delete */ int syncDir /* Not used on win32 */ ){ int cnt = 0; int rc; - DWORD attr; DWORD lastErrno; void *zConverted; UNUSED_PARAMETER(pVfs); UNUSED_PARAMETER(syncDir); @@ -35468,54 +35234,24 @@ zConverted = convertUtf8Filename(zFilename); if( zConverted==0 ){ return SQLITE_IOERR_NOMEM; } if( isNT() ){ - do { - attr = osGetFileAttributesW(zConverted); - if ( attr==INVALID_FILE_ATTRIBUTES ){ - rc = SQLITE_OK; /* Already gone? */ - break; - } - if ( attr&FILE_ATTRIBUTE_DIRECTORY ){ - rc = SQLITE_ERROR; /* Files only. */ - break; - } - if ( osDeleteFileW(zConverted) ){ - rc = SQLITE_OK; /* Deleted OK. */ - break; - } - if ( !retryIoerr(&cnt, &lastErrno) ){ - rc = SQLITE_ERROR; /* No more retries. */ - break; - } - } while(1); + rc = 1; + while( osGetFileAttributesW(zConverted)!=INVALID_FILE_ATTRIBUTES && + (rc = osDeleteFileW(zConverted))==0 && retryIoerr(&cnt, &lastErrno) ){} + rc = rc ? SQLITE_OK : SQLITE_ERROR; /* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. ** Since the ANSI version of these Windows API do not exist for WINCE, ** it's important to not reference them for WINCE builds. */ #if SQLITE_OS_WINCE==0 }else{ - do { - attr = osGetFileAttributesA(zConverted); - if ( attr==INVALID_FILE_ATTRIBUTES ){ - rc = SQLITE_OK; /* Already gone? */ - break; - } - if ( attr&FILE_ATTRIBUTE_DIRECTORY ){ - rc = SQLITE_ERROR; /* Files only. */ - break; - } - if ( osDeleteFileA(zConverted) ){ - rc = SQLITE_OK; /* Deleted OK. */ - break; - } - if ( !retryIoerr(&cnt, &lastErrno) ){ - rc = SQLITE_ERROR; /* No more retries. */ - break; - } - } while(1); + rc = 1; + while( osGetFileAttributesA(zConverted)!=INVALID_FILE_ATTRIBUTES && + (rc = osDeleteFileA(zConverted))==0 && retryIoerr(&cnt, &lastErrno) ){} + rc = rc ? SQLITE_OK : SQLITE_ERROR; #endif } if( rc ){ rc = winLogError(SQLITE_IOERR_DELETE, lastErrno, "winDelete", zFilename); @@ -37053,19 +36789,20 @@ int szExtra; /* Size of extra space in bytes */ int bPurgeable; /* True if cache is purgeable */ unsigned int nMin; /* Minimum number of pages reserved */ unsigned int nMax; /* Configured "cache_size" value */ unsigned int n90pct; /* nMax*9/10 */ - unsigned int iMaxKey; /* Largest key seen since xTruncate() */ /* Hash table of all pages. The following variables may only be accessed ** when the accessor is holding the PGroup mutex. */ unsigned int nRecyclable; /* Number of pages in the LRU list */ unsigned int nPage; /* Total number of pages in apHash */ unsigned int nHash; /* Number of slots in apHash[] */ PgHdr1 **apHash; /* Hash table for fast lookup by key */ + + unsigned int iMaxKey; /* Largest key seen since xTruncate() */ }; /* ** Each cache entry is represented by an instance of the following ** structure. Unless SQLITE_PCACHE_SEPARATE_HEADER is defined, a buffer of @@ -37105,12 +36842,12 @@ int nSlot; /* The number of pcache slots */ int nReserve; /* Try to keep nFreeSlot above this */ void *pStart, *pEnd; /* Bounds of pagecache malloc range */ /* Above requires no mutex. Use mutex below for variable that follow. */ sqlite3_mutex *mutex; /* Mutex for accessing the following: */ - PgFreeslot *pFree; /* Free page blocks */ int nFreeSlot; /* Number of unused pcache slots */ + PgFreeslot *pFree; /* Free page blocks */ /* The following value requires a mutex to change. We skip the mutex on ** reading because (1) most platforms read a 32-bit integer atomically and ** (2) even if an incorrect value is read, no great harm is done since this ** is really just an optimization. */ int bUnderPressure; /* True if low on PAGECACHE memory */ @@ -38073,15 +37810,10 @@ #define ROWSET_ENTRY_PER_CHUNK \ ((ROWSET_ALLOCATION_SIZE-8)/sizeof(struct RowSetEntry)) /* ** Each entry in a RowSet is an instance of the following object. -** -** This same object is reused to store a linked list of trees of RowSetEntry -** objects. In that alternative use, pRight points to the next entry -** in the list, pLeft points to the tree, and v is unused. The -** RowSet.pForest value points to the head of this forest list. */ struct RowSetEntry { i64 v; /* ROWID value for this entry */ struct RowSetEntry *pRight; /* Right subtree (larger entries) or list */ struct RowSetEntry *pLeft; /* Left subtree (smaller entries) */ @@ -38107,22 +37839,16 @@ struct RowSetChunk *pChunk; /* List of all chunk allocations */ sqlite3 *db; /* The database connection */ struct RowSetEntry *pEntry; /* List of entries using pRight */ struct RowSetEntry *pLast; /* Last entry on the pEntry list */ struct RowSetEntry *pFresh; /* Source of new entry objects */ - struct RowSetEntry *pForest; /* List of binary trees of entries */ + struct RowSetEntry *pTree; /* Binary tree of entries */ u16 nFresh; /* Number of objects on pFresh */ - u8 rsFlags; /* Various flags */ + u8 isSorted; /* True if pEntry is sorted */ u8 iBatch; /* Current insert batch */ }; -/* -** Allowed values for RowSet.rsFlags -*/ -#define ROWSET_SORTED 0x01 /* True if RowSet.pEntry is sorted */ -#define ROWSET_NEXT 0x02 /* True if sqlite3RowSetNext() has been called */ - /* ** Turn bulk memory into a RowSet object. N bytes of memory ** are available at pSpace. The db pointer is used as a memory context ** for any subsequent allocations that need to occur. ** Return a pointer to the new RowSet object. @@ -38139,14 +37865,14 @@ p = pSpace; p->pChunk = 0; p->db = db; p->pEntry = 0; p->pLast = 0; - p->pForest = 0; + p->pTree = 0; p->pFresh = (struct RowSetEntry*)(ROUND8(sizeof(*p)) + (char*)p); p->nFresh = (u16)((N - ROUND8(sizeof(*p)))/sizeof(struct RowSetEntry)); - p->rsFlags = ROWSET_SORTED; + p->isSorted = 1; p->iBatch = 0; return p; } /* @@ -38162,37 +37888,12 @@ } p->pChunk = 0; p->nFresh = 0; p->pEntry = 0; p->pLast = 0; - p->pForest = 0; - p->rsFlags = ROWSET_SORTED; -} - -/* -** Allocate a new RowSetEntry object that is associated with the -** given RowSet. Return a pointer to the new and completely uninitialized -** objected. -** -** In an OOM situation, the RowSet.db->mallocFailed flag is set and this -** routine returns NULL. -*/ -static struct RowSetEntry *rowSetEntryAlloc(RowSet *p){ - assert( p!=0 ); - if( p->nFresh==0 ){ - struct RowSetChunk *pNew; - pNew = sqlite3DbMallocRaw(p->db, sizeof(*pNew)); - if( pNew==0 ){ - return 0; - } - pNew->pNextChunk = p->pChunk; - p->pChunk = pNew; - p->pFresh = pNew->aEntry; - p->nFresh = ROWSET_ENTRY_PER_CHUNK; - } - p->nFresh--; - return p->pFresh++; + p->pTree = 0; + p->isSorted = 1; } /* ** Insert a new value into a RowSet. ** @@ -38200,25 +37901,34 @@ ** memory allocation fails. */ SQLITE_PRIVATE void sqlite3RowSetInsert(RowSet *p, i64 rowid){ struct RowSetEntry *pEntry; /* The new entry */ struct RowSetEntry *pLast; /* The last prior entry */ - - /* This routine is never called after sqlite3RowSetNext() */ - assert( p!=0 && (p->rsFlags & ROWSET_NEXT)==0 ); - - pEntry = rowSetEntryAlloc(p); - if( pEntry==0 ) return; + assert( p!=0 ); + if( p->nFresh==0 ){ + struct RowSetChunk *pNew; + pNew = sqlite3DbMallocRaw(p->db, sizeof(*pNew)); + if( pNew==0 ){ + return; + } + pNew->pNextChunk = p->pChunk; + p->pChunk = pNew; + p->pFresh = pNew->aEntry; + p->nFresh = ROWSET_ENTRY_PER_CHUNK; + } + pEntry = p->pFresh++; + p->nFresh--; pEntry->v = rowid; pEntry->pRight = 0; pLast = p->pLast; if( pLast ){ - if( (p->rsFlags & ROWSET_SORTED)!=0 && rowid<=pLast->v ){ - p->rsFlags &= ~ROWSET_SORTED; + if( p->isSorted && rowid<=pLast->v ){ + p->isSorted = 0; } pLast->pRight = pEntry; }else{ + assert( p->pEntry==0 ); /* Fires if INSERT after SMALLEST */ p->pEntry = pEntry; } p->pLast = pEntry; } @@ -38226,11 +37936,11 @@ ** Merge two lists of RowSetEntry objects. Remove duplicates. ** ** The input lists are connected via pRight pointers and are ** assumed to each already be in sorted order. */ -static struct RowSetEntry *rowSetEntryMerge( +static struct RowSetEntry *rowSetMerge( struct RowSetEntry *pA, /* First sorted list to be merged */ struct RowSetEntry *pB /* Second sorted list to be merged */ ){ struct RowSetEntry head; struct RowSetEntry *pTail; @@ -38260,33 +37970,36 @@ } return head.pRight; } /* -** Sort all elements on the list of RowSetEntry objects into order of -** increasing v. +** Sort all elements on the pEntry list of the RowSet into ascending order. */ -static struct RowSetEntry *rowSetEntrySort(struct RowSetEntry *pIn){ +static void rowSetSort(RowSet *p){ unsigned int i; - struct RowSetEntry *pNext, *aBucket[40]; + struct RowSetEntry *pEntry; + struct RowSetEntry *aBucket[40]; + assert( p->isSorted==0 ); memset(aBucket, 0, sizeof(aBucket)); - while( pIn ){ - pNext = pIn->pRight; - pIn->pRight = 0; + while( p->pEntry ){ + pEntry = p->pEntry; + p->pEntry = pEntry->pRight; + pEntry->pRight = 0; for(i=0; aBucket[i]; i++){ - pIn = rowSetEntryMerge(aBucket[i], pIn); + pEntry = rowSetMerge(aBucket[i], pEntry); aBucket[i] = 0; } - aBucket[i] = pIn; - pIn = pNext; + aBucket[i] = pEntry; } - pIn = 0; + pEntry = 0; for(i=0; ipEntry = pEntry; + p->pLast = 0; + p->isSorted = 1; } /* ** The input, pIn, is a binary tree (or subtree) of RowSetEntry objects. @@ -38376,41 +38089,24 @@ } return p; } /* -** Take all the entries on p->pEntry and on the trees in p->pForest and -** sort them all together into one big ordered list on p->pEntry. -** -** This routine should only be called once in the life of a RowSet. +** Convert the list in p->pEntry into a sorted list if it is not +** sorted already. If there is a binary tree on p->pTree, then +** convert it into a list too and merge it into the p->pEntry list. */ static void rowSetToList(RowSet *p){ - - /* This routine is called only once */ - assert( p!=0 && (p->rsFlags & ROWSET_NEXT)==0 ); - - if( (p->rsFlags & ROWSET_SORTED)==0 ){ - p->pEntry = rowSetEntrySort(p->pEntry); - } - - /* While this module could theoretically support it, sqlite3RowSetNext() - ** is never called after sqlite3RowSetText() for the same RowSet. So - ** there is never a forest to deal with. Should this change, simply - ** remove the assert() and the #if 0. */ - assert( p->pForest==0 ); -#if 0 - while( p->pForest ){ - struct RowSetEntry *pTree = p->pForest->pLeft; - if( pTree ){ - struct RowSetEntry *pHead, *pTail; - rowSetTreeToList(pTree, &pHead, &pTail); - p->pEntry = rowSetEntryMerge(p->pEntry, pHead); - } - p->pForest = p->pForest->pRight; - } -#endif - p->rsFlags |= ROWSET_NEXT; /* Verify this routine is never called again */ + if( !p->isSorted ){ + rowSetSort(p); + } + if( p->pTree ){ + struct RowSetEntry *pHead, *pTail; + rowSetTreeToList(p->pTree, &pHead, &pTail); + p->pTree = 0; + p->pEntry = rowSetMerge(p->pEntry, pHead); + } } /* ** Extract the smallest element from the RowSet. ** Write the element into *pRowid. Return 1 on success. Return @@ -38418,16 +38114,11 @@ ** ** After this routine has been called, the sqlite3RowSetInsert() ** routine may not be called again. */ SQLITE_PRIVATE int sqlite3RowSetNext(RowSet *p, i64 *pRowid){ - assert( p!=0 ); - - /* Merge the forest into a single sorted list on first call */ - if( (p->rsFlags & ROWSET_NEXT)==0 ) rowSetToList(p); - - /* Return the next entry on the list */ + rowSetToList(p); if( p->pEntry ){ *pRowid = p->pEntry->v; p->pEntry = p->pEntry->pRight; if( p->pEntry==0 ){ sqlite3RowSetClear(p); @@ -38439,70 +38130,30 @@ } /* ** Check to see if element iRowid was inserted into the the rowset as ** part of any insert batch prior to iBatch. Return 1 or 0. -** -** If this is the first test of a new batch and if there exist entires -** on pRowSet->pEntry, then sort those entires into the forest at -** pRowSet->pForest so that they can be tested. */ SQLITE_PRIVATE int sqlite3RowSetTest(RowSet *pRowSet, u8 iBatch, sqlite3_int64 iRowid){ - struct RowSetEntry *p, *pTree; - - /* This routine is never called after sqlite3RowSetNext() */ - assert( pRowSet!=0 && (pRowSet->rsFlags & ROWSET_NEXT)==0 ); - - /* Sort entries into the forest on the first test of a new batch - */ + struct RowSetEntry *p; if( iBatch!=pRowSet->iBatch ){ - p = pRowSet->pEntry; - if( p ){ - struct RowSetEntry **ppPrevTree = &pRowSet->pForest; - if( (pRowSet->rsFlags & ROWSET_SORTED)==0 ){ - p = rowSetEntrySort(p); - } - for(pTree = pRowSet->pForest; pTree; pTree=pTree->pRight){ - ppPrevTree = &pTree->pRight; - if( pTree->pLeft==0 ){ - pTree->pLeft = rowSetListToTree(p); - break; - }else{ - struct RowSetEntry *pAux, *pTail; - rowSetTreeToList(pTree->pLeft, &pAux, &pTail); - pTree->pLeft = 0; - p = rowSetEntryMerge(pAux, p); - } - } - if( pTree==0 ){ - *ppPrevTree = pTree = rowSetEntryAlloc(pRowSet); - if( pTree ){ - pTree->v = 0; - pTree->pRight = 0; - pTree->pLeft = rowSetListToTree(p); - } - } + if( pRowSet->pEntry ){ + rowSetToList(pRowSet); + pRowSet->pTree = rowSetListToTree(pRowSet->pEntry); pRowSet->pEntry = 0; pRowSet->pLast = 0; - pRowSet->rsFlags |= ROWSET_SORTED; } pRowSet->iBatch = iBatch; } - - /* Test to see if the iRowid value appears anywhere in the forest. - ** Return 1 if it does and 0 if not. - */ - for(pTree = pRowSet->pForest; pTree; pTree=pTree->pRight){ - p = pTree->pLeft; - while( p ){ - if( p->vpRight; - }else if( p->v>iRowid ){ - p = p->pLeft; - }else{ - return 1; - } + p = pRowSet->pTree; + while( p ){ + if( p->vpRight; + }else if( p->v>iRowid ){ + p = p->pLeft; + }else{ + return 1; } } return 0; } @@ -38573,11 +38224,10 @@ # define sqlite3WalFrames(u,v,w,x,y,z) 0 # define sqlite3WalCheckpoint(r,s,t,u,v,w,x,y,z) 0 # define sqlite3WalCallback(z) 0 # define sqlite3WalExclusiveMode(y,z) 0 # define sqlite3WalHeapMemory(z) 0 -# define sqlite3WalFramesize(z) 0 #else #define WAL_SAVEPOINT_NDATA 4 /* Connection to a write-ahead log (WAL) file. @@ -38655,17 +38305,10 @@ ** heap-memory for the wal-index. Otherwise, if the argument is NULL or the ** WAL module is using shared-memory, return false. */ SQLITE_PRIVATE int sqlite3WalHeapMemory(Wal *pWal); -#ifdef SQLITE_ENABLE_ZIPVFS -/* If the WAL file is not empty, return the number of bytes of content -** stored in each frame (i.e. the db page-size when the WAL was created). -*/ -SQLITE_PRIVATE int sqlite3WalFramesize(Wal *pWal); -#endif - #endif /* ifndef SQLITE_OMIT_WAL */ #endif /* _WAL_H_ */ /************** End of wal.h *************************************************/ /************** Continuing where we left off in pager.c **********************/ @@ -39258,10 +38901,11 @@ struct Pager { sqlite3_vfs *pVfs; /* OS functions to use for IO */ u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */ u8 journalMode; /* One of the PAGER_JOURNALMODE_* values */ u8 useJournal; /* Use a rollback journal on this file */ + u8 noReadlock; /* Do not bother to obtain readlocks */ u8 noSync; /* Do not sync the journal if true */ u8 fullSync; /* Do extra syncs of the journal for robustness */ u8 ckptSyncFlags; /* SYNC_NORMAL or SYNC_FULL for checkpoint */ u8 walSyncFlags; /* SYNC_NORMAL or SYNC_FULL for wal writes */ u8 syncFlags; /* SYNC_NORMAL or SYNC_FULL otherwise */ @@ -39316,13 +38960,13 @@ i64 journalSizeLimit; /* Size limit for persistent journal files */ char *zFilename; /* Name of the database file */ char *zJournal; /* Name of the journal file */ int (*xBusyHandler)(void*); /* Function to call when busy */ void *pBusyHandlerArg; /* Context argument for xBusyHandler */ - int aStat[3]; /* Total cache hits, misses and writes */ + int nHit, nMiss; /* Total cache hits and misses */ #ifdef SQLITE_TEST - int nRead; /* Database pages read */ + int nRead, nWrite; /* Database pages read/written */ #endif void (*xReiniter)(DbPage*); /* Call this routine when reloading pages */ #ifdef SQLITE_HAS_CODEC void *(*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */ void (*xCodecSizeChng)(void*,int,int); /* Notify of page size changes */ @@ -39335,19 +38979,10 @@ Wal *pWal; /* Write-ahead log used by "journal_mode=wal" */ char *zWal; /* File name for write-ahead log */ #endif }; -/* -** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains -** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS -** or CACHE_WRITE to sqlite3_db_status(). -*/ -#define PAGER_STAT_HIT 0 -#define PAGER_STAT_MISS 1 -#define PAGER_STAT_WRITE 2 - /* ** The following global variables hold counters used for ** testing purposes only. These variables do not exist in ** a non-testing build. These variables are not thread-safe. */ @@ -39514,11 +39149,11 @@ break; case PAGER_READER: assert( pPager->errCode==SQLITE_OK ); assert( p->eLock!=UNKNOWN_LOCK ); - assert( p->eLock>=SHARED_LOCK ); + assert( p->eLock>=SHARED_LOCK || p->noReadlock ); break; case PAGER_WRITER_LOCKED: assert( p->eLock!=UNKNOWN_LOCK ); assert( pPager->errCode==SQLITE_OK ); @@ -41626,11 +41261,10 @@ PgHdr *pList, /* List of frames to log */ Pgno nTruncate, /* Database size after this commit */ int isCommit /* True if this is a commit */ ){ int rc; /* Return code */ - int nList; /* Number of pages in pList */ #if defined(SQLITE_DEBUG) || defined(SQLITE_CHECK_PAGES) PgHdr *p; /* For looping over pages */ #endif assert( pPager->pWal ); @@ -41640,30 +41274,22 @@ for(p=pList; p && p->pDirty; p=p->pDirty){ assert( p->pgno < p->pDirty->pgno ); } #endif - assert( pList->pDirty==0 || isCommit ); if( isCommit ){ /* If a WAL transaction is being committed, there is no point in writing ** any pages with page numbers greater than nTruncate into the WAL file. ** They will never be read by any client. So remove them from the pDirty ** list here. */ PgHdr *p; PgHdr **ppNext = &pList; - nList = 0; - for(p=pList; (*ppNext = p)!=0; p=p->pDirty){ - if( p->pgno<=nTruncate ){ - ppNext = &p->pDirty; - nList++; - } + for(p=pList; (*ppNext = p); p=p->pDirty){ + if( p->pgno<=nTruncate ) ppNext = &p->pDirty; } assert( pList ); - }else{ - nList = 1; } - pPager->aStat[PAGER_STAT_WRITE] += nList; if( pList->pgno==1 ) pager_write_changecounter(pList); rc = sqlite3WalFrames(pPager->pWal, pPager->pageSize, pList, nTruncate, isCommit, pPager->walSyncFlags ); @@ -41732,11 +41358,11 @@ ** if the database size is not available. The database size is not ** available from the WAL sub-system if the log file is empty or ** contains no valid committed transactions. */ assert( pPager->eState==PAGER_OPEN ); - assert( pPager->eLock>=SHARED_LOCK ); + assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock ); nPage = sqlite3WalDbsize(pPager->pWal); /* If the database size was not available from the WAL sub-system, ** determine it based on the size of the database file. If the size ** of the database file is not an integer multiple of the page-size, @@ -41787,11 +41413,11 @@ ** other connection. */ static int pagerOpenWalIfPresent(Pager *pPager){ int rc = SQLITE_OK; assert( pPager->eState==PAGER_OPEN ); - assert( pPager->eLock>=SHARED_LOCK ); + assert( pPager->eLock>=SHARED_LOCK || pPager->noReadlock ); if( !pPager->tempFile ){ int isWal; /* True if WAL file exists */ Pgno nPage; /* Size of the database file */ @@ -42727,19 +42353,19 @@ memcpy(&pPager->dbFileVers, &pData[24], sizeof(pPager->dbFileVers)); } if( pgno>pPager->dbFileSize ){ pPager->dbFileSize = pgno; } - pPager->aStat[PAGER_STAT_WRITE]++; /* Update any backup objects copying the contents of this pager. */ sqlite3BackupUpdate(pPager->pBackup, pgno, (u8*)pList->pData); PAGERTRACE(("STORE %d page %d hash(%08x)\n", PAGERID(pPager), pgno, pager_pagehash(pList))); IOTRACE(("PGOUT %p %d\n", pPager, pgno)); PAGER_INCR(sqlite3_pager_writedb_count); + PAGER_INCR(pPager->nWrite); }else{ PAGERTRACE(("NOSTORE %d page %d\n", PAGERID(pPager), pgno)); } pager_set_pagehash(pList); pList = pList->pDirty; @@ -42950,11 +42576,11 @@ ** along with each page reference. This space is available to the user ** via the sqlite3PagerGetExtra() API. ** ** The flags argument is used to specify properties that affect the ** operation of the pager. It should be passed some bitwise combination -** of the PAGER_* flags. +** of the PAGER_OMIT_JOURNAL and PAGER_NO_READLOCK flags. ** ** The vfsFlags parameter is a bitmask to pass to the flags parameter ** of the xOpen() method of the supplied VFS when opening files. ** ** If the pager object is allocated and the specified file opened @@ -42981,10 +42607,11 @@ int readOnly = 0; /* True if this is a read-only file */ int journalFileSize; /* Bytes to allocate for each journal fd */ char *zPathname = 0; /* Full path to database file */ int nPathname = 0; /* Number of bytes in zPathname */ int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */ + int noReadlock = (flags & PAGER_NO_READLOCK)!=0; /* True to omit read-lock */ int pcacheSize = sqlite3PcacheSize(); /* Bytes to allocate for PCache */ u32 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */ const char *zUri = 0; /* URI args to copy */ int nUri = 0; /* Number of bytes of URI args at *zUri */ @@ -43187,10 +42814,11 @@ PAGERTRACE(("OPEN %d %s\n", FILEHANDLEID(pPager->fd), pPager->zFilename)); IOTRACE(("OPEN %p %s\n", pPager, pPager->zFilename)) pPager->useJournal = (u8)useJournal; + pPager->noReadlock = (noReadlock && readOnly) ?1:0; /* pPager->stmtOpen = 0; */ /* pPager->stmtInUse = 0; */ /* pPager->nRef = 0; */ /* pPager->stmtSize = 0; */ /* pPager->stmtJSize = 0; */ @@ -43408,15 +43036,18 @@ if( !pagerUseWal(pPager) && pPager->eState==PAGER_OPEN ){ int bHotJournal = 1; /* True if there exists a hot journal-file */ assert( !MEMDB ); + assert( pPager->noReadlock==0 || pPager->readOnly ); - rc = pager_wait_on_lock(pPager, SHARED_LOCK); - if( rc!=SQLITE_OK ){ - assert( pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK ); - goto failed; + if( pPager->noReadlock==0 ){ + rc = pager_wait_on_lock(pPager, SHARED_LOCK); + if( rc!=SQLITE_OK ){ + assert( pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK ); + goto failed; + } } /* If a journal file exists, and there is no RESERVED lock on the ** database file, then it either needs to be played back or deleted. */ @@ -43693,11 +43324,11 @@ if( (*ppPage)->pPager && !noContent ){ /* In this case the pcache already contains an initialized copy of ** the page. Return without further ado. */ assert( pgno<=PAGER_MAX_PGNO && pgno!=PAGER_MJ_PGNO(pPager) ); - pPager->aStat[PAGER_STAT_HIT]++; + pPager->nHit++; return SQLITE_OK; }else{ /* The pager cache has created a new page. Its content needs to ** be initialized. */ @@ -43735,11 +43366,11 @@ } memset(pPg->pData, 0, pPager->pageSize); IOTRACE(("ZERO %p %d\n", pPager, pgno)); }else{ assert( pPg->pPager==pPager ); - pPager->aStat[PAGER_STAT_MISS]++; + pPager->nMiss++; rc = readDbPage(pPg); if( rc!=SQLITE_OK ){ goto pager_acquire_err; } } @@ -44320,11 +43951,10 @@ const void *zBuf; assert( pPager->dbFileSize>0 ); CODEC2(pPager, pPgHdr->pData, 1, 6, rc=SQLITE_NOMEM, zBuf); if( rc==SQLITE_OK ){ rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0); - pPager->aStat[PAGER_STAT_WRITE]++; } if( rc==SQLITE_OK ){ pPager->changeCountDone = 1; } }else{ @@ -44764,15 +44394,15 @@ a[1] = sqlite3PcachePagecount(pPager->pPCache); a[2] = sqlite3PcacheGetCachesize(pPager->pPCache); a[3] = pPager->eState==PAGER_OPEN ? -1 : (int) pPager->dbSize; a[4] = pPager->eState; a[5] = pPager->errCode; - a[6] = pPager->aStat[PAGER_STAT_HIT]; - a[7] = pPager->aStat[PAGER_STAT_MISS]; + a[6] = pPager->nHit; + a[7] = pPager->nMiss; a[8] = 0; /* Used to be pPager->nOvfl */ a[9] = pPager->nRead; - a[10] = pPager->aStat[PAGER_STAT_WRITE]; + a[10] = pPager->nWrite; return a; } #endif /* @@ -44781,23 +44411,24 @@ ** current cache hit or miss count, according to the value of eStat. If the ** reset parameter is non-zero, the cache hit or miss count is zeroed before ** returning. */ SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *pPager, int eStat, int reset, int *pnVal){ + int *piStat; assert( eStat==SQLITE_DBSTATUS_CACHE_HIT || eStat==SQLITE_DBSTATUS_CACHE_MISS - || eStat==SQLITE_DBSTATUS_CACHE_WRITE ); + if( eStat==SQLITE_DBSTATUS_CACHE_HIT ){ + piStat = &pPager->nHit; + }else{ + piStat = &pPager->nMiss; + } - assert( SQLITE_DBSTATUS_CACHE_HIT+1==SQLITE_DBSTATUS_CACHE_MISS ); - assert( SQLITE_DBSTATUS_CACHE_HIT+2==SQLITE_DBSTATUS_CACHE_WRITE ); - assert( PAGER_STAT_HIT==0 && PAGER_STAT_MISS==1 && PAGER_STAT_WRITE==2 ); - - *pnVal += pPager->aStat[eStat - SQLITE_DBSTATUS_CACHE_HIT]; + *pnVal += *piStat; if( reset ){ - pPager->aStat[eStat - SQLITE_DBSTATUS_CACHE_HIT] = 0; + *piStat = 0; } } /* ** Return true if this is an in-memory pager. @@ -45420,11 +45051,11 @@ */ static int pagerOpenWal(Pager *pPager){ int rc = SQLITE_OK; assert( pPager->pWal==0 && pPager->tempFile==0 ); - assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK ); + assert( pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK || pPager->noReadlock); /* If the pager is already in exclusive-mode, the WAL module will use ** heap-memory for the wal-index instead of the VFS shared-memory ** implementation. Take the exclusive lock now, before opening the WAL ** file, to make sure this is safe. @@ -45535,24 +45166,10 @@ } } return rc; } -#ifdef SQLITE_ENABLE_ZIPVFS -/* -** A read-lock must be held on the pager when this function is called. If -** the pager is in WAL mode and the WAL file currently contains one or more -** frames, return the size in bytes of the page images stored within the -** WAL frames. Otherwise, if this is not a WAL database or the WAL file -** is empty, return 0. -*/ -SQLITE_PRIVATE int sqlite3PagerWalFramesize(Pager *pPager){ - assert( pPager->eState==PAGER_READER ); - return sqlite3WalFramesize(pPager->pWal); -} -#endif - #ifdef SQLITE_HAS_CODEC /* ** This function is called by the wal module when writing page content ** into the log file. ** @@ -47968,11 +47585,11 @@ testcase( sz<=32768 ); testcase( sz>=65536 ); iOffset = walFrameOffset(iRead, sz) + WAL_FRAME_HDRSIZE; *pInWal = 1; /* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */ - return sqlite3OsRead(pWal->pWalFd, pOut, (nOut>sz ? sz : nOut), iOffset); + return sqlite3OsRead(pWal->pWalFd, pOut, nOut, iOffset); } *pInWal = 0; return SQLITE_OK; } @@ -48639,22 +48256,10 @@ */ SQLITE_PRIVATE int sqlite3WalHeapMemory(Wal *pWal){ return (pWal && pWal->exclusiveMode==WAL_HEAPMEMORY_MODE ); } -#ifdef SQLITE_ENABLE_ZIPVFS -/* -** If the argument is not NULL, it points to a Wal object that holds a -** read-lock. This function returns the database page-size if it is known, -** or zero if it is not (or if pWal is NULL). -*/ -SQLITE_PRIVATE int sqlite3WalFramesize(Wal *pWal){ - assert( pWal==0 || pWal->readLock>=0 ); - return (pWal ? pWal->szPage : 0); -} -#endif - #endif /* #ifndef SQLITE_OMIT_WAL */ /************** End of wal.c *************************************************/ /************** Begin file btmutex.c *****************************************/ /* @@ -48959,13 +48564,14 @@ u16 minLocal; /* Copy of BtShared.minLocal or BtShared.minLeaf */ u16 cellOffset; /* Index in aData of first cell pointer */ u16 nFree; /* Number of free bytes on the page */ u16 nCell; /* Number of cells on this page, local and ovfl */ u16 maskPage; /* Mask for page offset */ - u16 aiOvfl[5]; /* Insert the i-th overflow cell before the aiOvfl-th - ** non-overflow cell */ - u8 *apOvfl[5]; /* Pointers to the body of overflow cells */ + struct _OvflCell { /* Cells that will not fit on aData[] */ + u8 *pCell; /* Pointers to the body of the overflow cell */ + u16 idx; /* Insert this cell before idx-th non-overflow cell */ + } aOvfl[5]; BtShared *pBt; /* Pointer to BtShared that this page is part of */ u8 *aData; /* Pointer to disk image of the page data */ u8 *aDataEnd; /* One byte past the end of usable data */ u8 *aCellIdx; /* The cell index area */ DbPage *pDbPage; /* Pager page handle */ @@ -49169,13 +48775,10 @@ struct BtCursor { Btree *pBtree; /* The Btree to which this cursor belongs */ BtShared *pBt; /* The BtShared this cursor points to */ BtCursor *pNext, *pPrev; /* Forms a linked list of all cursors */ struct KeyInfo *pKeyInfo; /* Argument passed to comparison function */ -#ifndef SQLITE_OMIT_INCRBLOB - Pgno *aOverflow; /* Cache of overflow page locations */ -#endif Pgno pgnoRoot; /* The root page of this tree */ sqlite3_int64 cachedRowid; /* Next rowid cache. 0 means not valid */ CellInfo info; /* A parse of the cell we are pointing at */ i64 nKey; /* Size of pKey, or last integer key */ void *pKey; /* Saved key that was cursor's last known position */ @@ -49183,10 +48786,11 @@ u8 wrFlag; /* True if writable */ u8 atLast; /* Cursor pointing to the last entry */ u8 validNKey; /* True if info.nKey is valid */ u8 eState; /* One of the CURSOR_XXX constants (see below) */ #ifndef SQLITE_OMIT_INCRBLOB + Pgno *aOverflow; /* Cache of overflow page locations */ u8 isIncrblobHandle; /* True if this cursor is an incr. io handle */ #endif i16 iPage; /* Index of current page in apPage */ u16 aiIdx[BTCURSOR_MAX_DEPTH]; /* Current index in apPage[i] */ MemPage *apPage[BTCURSOR_MAX_DEPTH]; /* Pages from root to current page */ @@ -49306,23 +48910,17 @@ /* ** This structure is passed around through all the sanity checking routines ** in order to keep track of some global state information. -** -** The aRef[] array is allocated so that there is 1 bit for each page in -** the database. As the integrity-check proceeds, for each page used in -** the database the corresponding bit is set. This allows integrity-check to -** detect pages that are used twice and orphaned pages (both of which -** indicate corruption). */ typedef struct IntegrityCk IntegrityCk; struct IntegrityCk { BtShared *pBt; /* The tree being checked out */ Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ - u8 *aPgRef; /* 1 bit per page in the db (see above) */ Pgno nPage; /* Number of pages in the database */ + int *anRef; /* Number of times each page is referenced */ int mxErr; /* Stop accumulating errors when this reaches zero */ int nErr; /* Number of messages written to zErrMsg so far */ int mallocFailed; /* A memory allocation error has occurred */ StrAccum errMsg; /* Accumulate the error message text here */ }; @@ -50478,14 +50076,16 @@ static u8 *findOverflowCell(MemPage *pPage, int iCell){ int i; assert( sqlite3_mutex_held(pPage->pBt->mutex) ); for(i=pPage->nOverflow-1; i>=0; i--){ int k; - k = pPage->aiOvfl[i]; + struct _OvflCell *pOvfl; + pOvfl = &pPage->aOvfl[i]; + k = pOvfl->idx; if( k<=iCell ){ if( k==iCell ){ - return pPage->apOvfl[i]; + return pOvfl->pCell; } iCell--; } } return findCell(pPage, iCell); @@ -51295,12 +50895,15 @@ ** when sqlite3BtreeClose() is called. ** ** If zFilename is ":memory:" then an in-memory database is created ** that is automatically destroyed when it is closed. ** -** The "flags" parameter is a bitmask that might contain bits like -** BTREE_OMIT_JOURNAL and/or BTREE_MEMORY. +** The "flags" parameter is a bitmask that might contain bits +** BTREE_OMIT_JOURNAL and/or BTREE_NO_READLOCK. The BTREE_NO_READLOCK +** bit is also set if the SQLITE_NoReadlock flags is set in db->flags. +** These flags are passed through into sqlite3PagerOpen() and must +** be the same values as PAGER_OMIT_JOURNAL and PAGER_NO_READLOCK. ** ** If the database is already opened in the same database connection ** and we are in shared cache mode, then the open will fail with an ** SQLITE_CONSTRAINT error. We cannot allow two or more BtShared ** objects in the same database connection since doing so will lead @@ -51343,10 +50946,13 @@ assert( (flags & BTREE_UNORDERED)==0 || (flags & BTREE_SINGLE)!=0 ); /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ assert( (flags & BTREE_SINGLE)==0 || isTempDb ); + if( db->flags & SQLITE_NoReadlock ){ + flags |= BTREE_NO_READLOCK; + } if( isMemdb ){ flags |= BTREE_MEMORY; } if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (isMemdb || isTempDb) ){ vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB; @@ -51649,11 +51255,11 @@ /* Rollback any active transaction and free the handle structure. ** The call to sqlite3BtreeRollback() drops any table-locks held by ** this handle. */ - sqlite3BtreeRollback(p, SQLITE_OK); + sqlite3BtreeRollback(p); sqlite3BtreeLeave(p); /* If there are still other outstanding references to the shared-btree ** structure, return now. The remainder of this procedure cleans ** up the shared-btree. @@ -52887,11 +52493,10 @@ ** save the state of the cursor. The cursor must be ** invalidated. */ SQLITE_PRIVATE void sqlite3BtreeTripAllCursors(Btree *pBtree, int errCode){ BtCursor *p; - if( pBtree==0 ) return; sqlite3BtreeEnter(pBtree); for(p=pBtree->pBt->pCursor; p; p=p->pNext){ int i; sqlite3BtreeClearCursor(p); p->eState = CURSOR_FAULT; @@ -52911,24 +52516,29 @@ ** in an error. ** ** This will release the write lock on the database file. If there ** are no active cursors, it also releases the read lock. */ -SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p, int tripCode){ +SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *p){ int rc; BtShared *pBt = p->pBt; MemPage *pPage1; sqlite3BtreeEnter(p); - if( tripCode==SQLITE_OK ){ - rc = tripCode = saveAllCursors(pBt, 0, 0); - }else{ - rc = SQLITE_OK; - } - if( tripCode ){ - sqlite3BtreeTripAllCursors(p, tripCode); - } + rc = saveAllCursors(pBt, 0, 0); +#ifndef SQLITE_OMIT_SHARED_CACHE + if( rc!=SQLITE_OK ){ + /* This is a horrible situation. An IO or malloc() error occurred whilst + ** trying to save cursor positions. If this is an automatic rollback (as + ** the result of a constraint, malloc() failure or IO error) then + ** the cache may be internally inconsistent (not contain valid trees) so + ** we cannot simply return the error to the caller. Instead, abort + ** all queries that may be using any of the cursors that failed to save. + */ + sqlite3BtreeTripAllCursors(p, rc); + } +#endif btreeIntegrity(p); if( p->inTrans==TRANS_WRITE ){ int rc2; @@ -55123,11 +54733,11 @@ ** content of the cell. ** ** If the cell content will fit on the page, then put it there. If it ** will not fit, then make a copy of the cell content into pTemp if ** pTemp is not null. Regardless of pTemp, allocate a new entry -** in pPage->apOvfl[] and make it point to the cell content (either +** in pPage->aOvfl[] and make it point to the cell content (either ** in pTemp or the original pCell) and also record its index. ** Allocating a new entry in pPage->aCell[] implies that ** pPage->nOverflow is incremented. ** ** If nSkip is non-zero, then do not copy the first nSkip bytes of the @@ -55157,12 +54767,11 @@ if( *pRC ) return; assert( i>=0 && i<=pPage->nCell+pPage->nOverflow ); assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=10921 ); - assert( pPage->nOverflow<=ArraySize(pPage->apOvfl) ); - assert( ArraySize(pPage->apOvfl)==ArraySize(pPage->aiOvfl) ); + assert( pPage->nOverflow<=ArraySize(pPage->aOvfl) ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); /* The cell should normally be sized correctly. However, when moving a ** malformed cell from a leaf page to an interior page, if the cell size ** wanted to be less than 4 but got rounded up to 4 on the leaf, then size ** might be less than 8 (leaf-size + pointer) on the interior node. Hence @@ -55175,13 +54784,13 @@ } if( iChild ){ put4byte(pCell, iChild); } j = pPage->nOverflow++; - assert( j<(int)(sizeof(pPage->apOvfl)/sizeof(pPage->apOvfl[0])) ); - pPage->apOvfl[j] = pCell; - pPage->aiOvfl[j] = (u16)i; + assert( j<(int)(sizeof(pPage->aOvfl)/sizeof(pPage->aOvfl[0])) ); + pPage->aOvfl[j].pCell = pCell; + pPage->aOvfl[j].idx = (u16)i; }else{ int rc = sqlite3PagerWrite(pPage->pDbPage); if( rc!=SQLITE_OK ){ *pRC = rc; return; @@ -55325,11 +54934,11 @@ rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0); if( rc==SQLITE_OK ){ u8 *pOut = &pSpace[4]; - u8 *pCell = pPage->apOvfl[0]; + u8 *pCell = pPage->aOvfl[0].pCell; u16 szCell = cellSizePtr(pPage, pCell); u8 *pStop; assert( sqlite3PagerIswriteable(pNew->pDbPage) ); assert( pPage->aData[0]==(PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF) ); @@ -55435,11 +55044,11 @@ ** parent page stored in the pointer map is page pTo. If pFrom contained ** any cells with overflow page pointers, then the corresponding pointer ** map entries are also updated so that the parent page is page pTo. ** ** If pFrom is currently carrying any overflow cells (entries in the -** MemPage.apOvfl[] array), they are not copied to pTo. +** MemPage.aOvfl[] array), they are not copied to pTo. ** ** Before returning, page pTo is reinitialized using btreeInitPage(). ** ** The performance of this function is not critical. It is only used by ** the balance_shallower() and balance_deeper() procedures, neither of @@ -55572,11 +55181,11 @@ ** this overflow cell is present, it must be the cell with ** index iParentIdx. This scenario comes about when this function ** is called (indirectly) from sqlite3BtreeDelete(). */ assert( pParent->nOverflow==0 || pParent->nOverflow==1 ); - assert( pParent->nOverflow==0 || pParent->aiOvfl[0]==iParentIdx ); + assert( pParent->nOverflow==0 || pParent->aOvfl[0].idx==iParentIdx ); if( !aOvflSpace ){ return SQLITE_NOMEM; } @@ -55619,12 +55228,12 @@ goto balance_cleanup; } nMaxCells += 1+apOld[i]->nCell+apOld[i]->nOverflow; if( (i--)==0 ) break; - if( i+nxDiv==pParent->aiOvfl[0] && pParent->nOverflow ){ - apDiv[i] = pParent->apOvfl[0]; + if( i+nxDiv==pParent->aOvfl[0].idx && pParent->nOverflow ){ + apDiv[i] = pParent->aOvfl[0].pCell; pgno = get4byte(apDiv[i]); szNew[i] = cellSizePtr(pParent, apDiv[i]); pParent->nOverflow = 0; }else{ apDiv[i] = findCell(pParent, i+nxDiv-pParent->nOverflow); @@ -56061,11 +55670,11 @@ ** actually moved between pages. */ MemPage *pNew = apNew[0]; MemPage *pOld = apCopy[0]; int nOverflow = pOld->nOverflow; int iNextOld = pOld->nCell + nOverflow; - int iOverflow = (nOverflow ? pOld->aiOvfl[0] : -1); + int iOverflow = (nOverflow ? pOld->aOvfl[0].idx : -1); j = 0; /* Current 'old' sibling page */ k = 0; /* Current 'new' sibling page */ for(i=0; inCell + pOld->nOverflow; if( pOld->nOverflow ){ nOverflow = pOld->nOverflow; - iOverflow = i + !leafData + pOld->aiOvfl[0]; + iOverflow = i + !leafData + pOld->aOvfl[0].idx; } isDivider = !leafData; } assert(nOverflow>0 || iOverflowaiOvfl[0]==pOld->aiOvfl[1]-1); - assert(nOverflow<3 || pOld->aiOvfl[1]==pOld->aiOvfl[2]-1); + assert(nOverflow<2 || pOld->aOvfl[0].idx==pOld->aOvfl[1].idx-1); + assert(nOverflow<3 || pOld->aOvfl[1].idx==pOld->aOvfl[2].idx-1); if( i==iOverflow ){ isDivider = 1; if( (--nOverflow)>0 ){ iOverflow++; } @@ -56203,14 +55812,11 @@ assert( pChild->nCell==pRoot->nCell ); TRACE(("BALANCE: copy root %d into %d\n", pRoot->pgno, pChild->pgno)); /* Copy the overflow cells from pRoot to pChild */ - memcpy(pChild->aiOvfl, pRoot->aiOvfl, - pRoot->nOverflow*sizeof(pRoot->aiOvfl[0])); - memcpy(pChild->apOvfl, pRoot->apOvfl, - pRoot->nOverflow*sizeof(pRoot->apOvfl[0])); + memcpy(pChild->aOvfl, pRoot->aOvfl, pRoot->nOverflow*sizeof(pRoot->aOvfl[0])); pChild->nOverflow = pRoot->nOverflow; /* Zero the contents of pRoot. Then install pChild as the right-child. */ zeroPage(pRoot, pChild->aData[0] & ~PTF_LEAF); put4byte(&pRoot->aData[pRoot->hdrOffset+8], pgnoChild); @@ -56269,11 +55875,11 @@ rc = sqlite3PagerWrite(pParent->pDbPage); if( rc==SQLITE_OK ){ #ifndef SQLITE_OMIT_QUICKBALANCE if( pPage->hasData && pPage->nOverflow==1 - && pPage->aiOvfl[0]==pPage->nCell + && pPage->aOvfl[0].idx==pPage->nCell && pParent->pgno!=1 && pParent->nCell==iIdx ){ /* Call balance_quick() to create a new sibling of pPage on which ** to store the overflow cell. balance_quick() inserts a new cell @@ -56396,10 +56002,17 @@ ** expecting an index b-tree, then the caller should be inserting blob ** keys with no associated data. If the cursor was opened expecting an ** intkey table, the caller should be inserting integer keys with a ** blob of associated data. */ assert( (pKey==0)==(pCur->pKeyInfo==0) ); + + /* If this is an insert into a table b-tree, invalidate any incrblob + ** cursors open on the row being replaced (assuming this is a replace + ** operation - if it is not, the following is a no-op). */ + if( pCur->pKeyInfo==0 ){ + invalidateIncrblobCursors(p, nKey, 0); + } /* Save the positions of any other cursors open on this table. ** ** In some cases, the call to btreeMoveto() below is a no-op. For ** example, when inserting data into a table with auto-generated integer @@ -56410,18 +56023,10 @@ ** doing any work. To avoid thwarting these optimizations, it is important ** not to clear the cursor here. */ rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur); if( rc ) return rc; - - /* If this is an insert into a table b-tree, invalidate any incrblob - ** cursors open on the row being replaced (assuming this is a replace - ** operation - if it is not, the following is a no-op). */ - if( pCur->pKeyInfo==0 ){ - invalidateIncrblobCursors(p, nKey, 0); - } - if( !loc ){ rc = btreeMoveto(pCur, pKey, nKey, appendBias, &loc); if( rc ) return rc; } assert( pCur->eState==CURSOR_VALID || (pCur->eState==CURSOR_INVALID && loc) ); @@ -56527,10 +56132,16 @@ if( NEVER(pCur->aiIdx[pCur->iPage]>=pCur->apPage[pCur->iPage]->nCell) || NEVER(pCur->eState!=CURSOR_VALID) ){ return SQLITE_ERROR; /* Something has gone awry. */ } + + /* If this is a delete operation to remove a row from a table b-tree, + ** invalidate any incrblob cursors open on the row being deleted. */ + if( pCur->pKeyInfo==0 ){ + invalidateIncrblobCursors(p, pCur->info.nKey, 0); + } iCellDepth = pCur->iPage; iCellIdx = pCur->aiIdx[iCellDepth]; pPage = pCur->apPage[iCellDepth]; pCell = findCell(pPage, iCellIdx); @@ -56553,17 +56164,10 @@ ** deleted writable. Then free any overflow pages associated with the ** entry and finally remove the cell itself from within the page. */ rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur); if( rc ) return rc; - - /* If this is a delete operation to remove a row from a table b-tree, - ** invalidate any incrblob cursors open on the row being deleted. */ - if( pCur->pKeyInfo==0 ){ - invalidateIncrblobCursors(p, pCur->info.nKey, 0); - } - rc = sqlite3PagerWrite(pPage->pDbPage); if( rc ) return rc; rc = clearCell(pPage, pCell); dropCell(pPage, iCellIdx, cellSizePtr(pPage, pCell), &rc); if( rc ) return rc; @@ -56840,18 +56444,18 @@ SQLITE_PRIVATE int sqlite3BtreeClearTable(Btree *p, int iTable, int *pnChange){ int rc; BtShared *pBt = p->pBt; sqlite3BtreeEnter(p); assert( p->inTrans==TRANS_WRITE ); + + /* Invalidate all incrblob cursors open on table iTable (assuming iTable + ** is the root of a table b-tree - if it is not, the following call is + ** a no-op). */ + invalidateIncrblobCursors(p, 0, 1); rc = saveAllCursors(pBt, (Pgno)iTable, 0); - if( SQLITE_OK==rc ){ - /* Invalidate all incrblob cursors open on table iTable (assuming iTable - ** is the root of a table b-tree - if it is not, the following call is - ** a no-op). */ - invalidateIncrblobCursors(p, 0, 1); rc = clearDatabasePage(pBt, (Pgno)iTable, 0, pnChange); } sqlite3BtreeLeave(p); return rc; } @@ -57162,29 +56766,10 @@ } } #endif /* SQLITE_OMIT_INTEGRITY_CHECK */ #ifndef SQLITE_OMIT_INTEGRITY_CHECK - -/* -** Return non-zero if the bit in the IntegrityCk.aPgRef[] array that -** corresponds to page iPg is already set. -*/ -static int getPageReferenced(IntegrityCk *pCheck, Pgno iPg){ - assert( iPg<=pCheck->nPage && sizeof(pCheck->aPgRef[0])==1 ); - return (pCheck->aPgRef[iPg/8] & (1 << (iPg & 0x07))); -} - -/* -** Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg. -*/ -static void setPageReferenced(IntegrityCk *pCheck, Pgno iPg){ - assert( iPg<=pCheck->nPage && sizeof(pCheck->aPgRef[0])==1 ); - pCheck->aPgRef[iPg/8] |= (1 << (iPg & 0x07)); -} - - /* ** Add 1 to the reference count for page iPage. If this is the second ** reference to the page, add an error message to pCheck->zErrMsg. ** Return 1 if there are 2 ore more references to the page and 0 if ** if this is the first reference to the page. @@ -57195,16 +56780,15 @@ if( iPage==0 ) return 1; if( iPage>pCheck->nPage ){ checkAppendMsg(pCheck, zContext, "invalid page number %d", iPage); return 1; } - if( getPageReferenced(pCheck, iPage) ){ + if( pCheck->anRef[iPage]==1 ){ checkAppendMsg(pCheck, zContext, "2nd reference to page %d", iPage); return 1; } - setPageReferenced(pCheck, iPage); - return 0; + return (pCheck->anRef[iPage]++)>1; } #ifndef SQLITE_OMIT_AUTOVACUUM /* ** Check that the entry in the pointer-map for page iChild maps to @@ -57576,19 +57160,21 @@ *pnErr = 0; if( sCheck.nPage==0 ){ sqlite3BtreeLeave(p); return 0; } - - sCheck.aPgRef = sqlite3MallocZero((sCheck.nPage / 8)+ 1); - if( !sCheck.aPgRef ){ + sCheck.anRef = sqlite3Malloc( (sCheck.nPage+1)*sizeof(sCheck.anRef[0]) ); + if( !sCheck.anRef ){ *pnErr = 1; sqlite3BtreeLeave(p); return 0; } + for(i=0; i<=sCheck.nPage; i++){ sCheck.anRef[i] = 0; } i = PENDING_BYTE_PAGE(pBt); - if( i<=sCheck.nPage ) setPageReferenced(&sCheck, i); + if( i<=sCheck.nPage ){ + sCheck.anRef[i] = 1; + } sqlite3StrAccumInit(&sCheck.errMsg, zErr, sizeof(zErr), 20000); sCheck.errMsg.useMalloc = 2; /* Check the integrity of the freelist */ @@ -57609,22 +57195,22 @@ /* Make sure every page in the file is referenced */ for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){ #ifdef SQLITE_OMIT_AUTOVACUUM - if( getPageReferenced(&sCheck, i)==0 ){ + if( sCheck.anRef[i]==0 ){ checkAppendMsg(&sCheck, 0, "Page %d is never used", i); } #else /* If the database supports auto-vacuum, make sure no tables contain ** references to pointer-map pages. */ - if( getPageReferenced(&sCheck, i)==0 && + if( sCheck.anRef[i]==0 && (PTRMAP_PAGENO(pBt, i)!=i || !pBt->autoVacuum) ){ checkAppendMsg(&sCheck, 0, "Page %d is never used", i); } - if( getPageReferenced(&sCheck, i)!=0 && + if( sCheck.anRef[i]!=0 && (PTRMAP_PAGENO(pBt, i)==i && pBt->autoVacuum) ){ checkAppendMsg(&sCheck, 0, "Pointer map page %d is referenced", i); } #endif } @@ -57641,11 +57227,11 @@ } /* Clean up and report errors. */ sqlite3BtreeLeave(p); - sqlite3_free(sCheck.aPgRef); + sqlite3_free(sCheck.anRef); if( sCheck.mallocFailed ){ sqlite3StrAccumReset(&sCheck.errMsg); *pnErr = sCheck.nErr+1; return 0; } @@ -58466,11 +58052,11 @@ } *pp = p->pNext; } /* If a transaction is still open on the Btree, roll it back. */ - sqlite3BtreeRollback(p->pDest, SQLITE_OK); + sqlite3BtreeRollback(p->pDest); /* Set the error code of the destination database handle. */ rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc; sqlite3Error(p->pDestDb, rc, 0); @@ -58677,14 +58263,14 @@ /* ** Make sure pMem->z points to a writable allocation of at least ** n bytes. ** -** If the third argument passed to this function is true, then memory -** cell pMem must contain a string or blob. In this case the content is -** preserved. Otherwise, if the third parameter to this function is false, -** any current string or blob value may be discarded. +** If the memory cell currently contains string or blob data +** and the third argument passed to this function is true, the +** current content of the cell is preserved. Otherwise, it may +** be discarded. ** ** This function sets the MEM_Dyn flag and clears any xDel callback. ** It also clears MEM_Ephem and MEM_Static. If the preserve flag is ** not set, Mem.n is zeroed. */ @@ -58695,14 +58281,10 @@ ((pMem->flags&MEM_Ephem) ? 1 : 0) + ((pMem->flags&MEM_Static) ? 1 : 0) ); assert( (pMem->flags&MEM_RowSet)==0 ); - /* If the preserve flag is set to true, then the memory cell must already - ** contain a valid string or blob value. */ - assert( preserve==0 || pMem->flags&(MEM_Blob|MEM_Str) ); - if( n<32 ) n = 32; if( sqlite3DbMallocSize(pMem->db, pMem->zMalloc)z==pMem->zMalloc ){ pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n); preserve = 0; @@ -58714,11 +58296,10 @@ if( pMem->z && preserve && pMem->zMalloc && pMem->z!=pMem->zMalloc ){ memcpy(pMem->zMalloc, pMem->z, pMem->n); } if( pMem->flags&MEM_Dyn && pMem->xDel ){ - assert( pMem->xDel!=SQLITE_DYNAMIC ); pMem->xDel((void *)(pMem->z)); } pMem->z = pMem->zMalloc; if( pMem->z==0 ){ @@ -58894,11 +58475,10 @@ sqlite3VdbeMemFinalize(p, p->u.pDef); assert( (p->flags & MEM_Agg)==0 ); sqlite3VdbeMemRelease(p); }else if( p->flags&MEM_Dyn && p->xDel ){ assert( (p->flags&MEM_RowSet)==0 ); - assert( p->xDel!=SQLITE_DYNAMIC ); p->xDel((void *)p->z); p->xDel = 0; }else if( p->flags&MEM_RowSet ){ sqlite3RowSetClear(p->u.pRowSet); }else if( p->flags&MEM_Frame ){ @@ -59037,18 +58617,12 @@ ** the second condition under the assumption that addition overflow causes ** values to wrap around. On x86 hardware, the third term is always ** true and could be omitted. But we leave it in because other ** architectures might behave differently. */ - if( pMem->r==(double)pMem->u.i - && pMem->u.i>SMALLEST_INT64 -#if defined(__i486__) || defined(__x86_64__) - && ALWAYS(pMem->u.iu.ir==(double)pMem->u.i && pMem->u.i>SMALLEST_INT64 + && ALWAYS(pMem->u.iflags |= MEM_Int; } } /* @@ -60018,15 +59592,18 @@ ** Hence, a negative P2 value is a label that has yet to be resolved. ** ** Zero is returned if a malloc() fails. */ SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *p){ - int i = p->nLabel++; + int i; + i = p->nLabel++; assert( p->magic==VDBE_MAGIC_INIT ); - if( (i & (i-1))==0 ){ - p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, - (i*2+1)*sizeof(p->aLabel[0])); + if( i>=p->nLabelAlloc ){ + int n = p->nLabelAlloc*2 + 5; + p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, + n*sizeof(p->aLabel[0])); + p->nLabelAlloc = sqlite3DbMallocSize(p->db, p->aLabel)/sizeof(p->aLabel[0]); } if( p->aLabel ){ p->aLabel[i] = -1; } return -1-i; @@ -61017,11 +60594,11 @@ int nByte = (nSub+1)*sizeof(SubProgram*); int j; for(j=0; jp4.pProgram ) break; } - if( j==nSub && SQLITE_OK==sqlite3VdbeMemGrow(pSub, nByte, nSub!=0) ){ + if( j==nSub && SQLITE_OK==sqlite3VdbeMemGrow(pSub, nByte, 1) ){ apSub = (SubProgram **)pSub->z; apSub[nSub++] = pOp->p4.pProgram; pSub->flags |= MEM_Blob; pSub->n = nSub*sizeof(SubProgram*); } @@ -61779,10 +61356,36 @@ assert( nWrite==db->writeVdbeCnt ); } #else #define checkActiveVdbeCnt(x) #endif + +/* +** For every Btree that in database connection db which +** has been modified, "trip" or invalidate each cursor in +** that Btree might have been modified so that the cursor +** can never be used again. This happens when a rollback +*** occurs. We have to trip all the other cursors, even +** cursor from other VMs in different database connections, +** so that none of them try to use the data at which they +** were pointing and which now may have been changed due +** to the rollback. +** +** Remember that a rollback can delete tables complete and +** reorder rootpages. So it is not sufficient just to save +** the state of the cursor. We have to invalidate the cursor +** so that it is never used again. +*/ +static void invalidateCursorsOnModifiedBtrees(sqlite3 *db){ + int i; + for(i=0; inDb; i++){ + Btree *p = db->aDb[i].pBt; + if( p && sqlite3BtreeIsInTrans(p) ){ + sqlite3BtreeTripAllCursors(p, SQLITE_ABORT); + } + } +} /* ** If the Vdbe passed as the first argument opened a statement-transaction, ** close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or ** SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement @@ -61944,11 +61547,12 @@ eStatementOp = SAVEPOINT_ROLLBACK; }else{ /* We are forced to roll back the active transaction. Before doing ** so, abort any other statements this handle currently has active. */ - sqlite3RollbackAll(db, SQLITE_ABORT_ROLLBACK); + invalidateCursorsOnModifiedBtrees(db); + sqlite3RollbackAll(db); sqlite3CloseSavepoints(db); db->autoCommit = 1; } } } @@ -61986,26 +61590,27 @@ if( rc==SQLITE_BUSY && p->readOnly ){ sqlite3VdbeLeave(p); return SQLITE_BUSY; }else if( rc!=SQLITE_OK ){ p->rc = rc; - sqlite3RollbackAll(db, SQLITE_OK); + sqlite3RollbackAll(db); }else{ db->nDeferredCons = 0; sqlite3CommitInternalChanges(db); } }else{ - sqlite3RollbackAll(db, SQLITE_OK); + sqlite3RollbackAll(db); } db->nStatement = 0; }else if( eStatementOp==0 ){ if( p->rc==SQLITE_OK || p->errorAction==OE_Fail ){ eStatementOp = SAVEPOINT_RELEASE; }else if( p->errorAction==OE_Abort ){ eStatementOp = SAVEPOINT_ROLLBACK; }else{ - sqlite3RollbackAll(db, SQLITE_ABORT_ROLLBACK); + invalidateCursorsOnModifiedBtrees(db); + sqlite3RollbackAll(db); sqlite3CloseSavepoints(db); db->autoCommit = 1; } } @@ -62021,11 +61626,12 @@ if( p->rc==SQLITE_OK || p->rc==SQLITE_CONSTRAINT ){ p->rc = rc; sqlite3DbFree(db, p->zErrMsg); p->zErrMsg = 0; } - sqlite3RollbackAll(db, SQLITE_ABORT_ROLLBACK); + invalidateCursorsOnModifiedBtrees(db); + sqlite3RollbackAll(db); sqlite3CloseSavepoints(db); db->autoCommit = 1; } } @@ -62038,10 +61644,16 @@ }else{ sqlite3VdbeSetChanges(db, 0); } p->nChange = 0; } + + /* Rollback or commit any schema changes that occurred. */ + if( p->rc!=SQLITE_OK && db->flags&SQLITE_InternChanges ){ + sqlite3ResetInternalSchema(db, -1); + db->flags = (db->flags | SQLITE_InternChanges); + } /* Release the locks */ sqlite3VdbeLeave(p); } @@ -66458,30 +66070,23 @@ arithmetic_result_is_null: sqlite3VdbeMemSetNull(pOut); break; } -/* Opcode: CollSeq P1 * * P4 +/* Opcode: CollSeq * * P4 ** ** P4 is a pointer to a CollSeq struct. If the next call to a user function ** or aggregate calls sqlite3GetFuncCollSeq(), this collation sequence will ** be returned. This is used by the built-in min(), max() and nullif() ** functions. ** -** If P1 is not zero, then it is a register that a subsequent min() or -** max() aggregate will set to 1 if the current row is not the minimum or -** maximum. The P1 register is initialized to 0 by this instruction. -** ** The interface used by the implementation of the aforementioned functions ** to retrieve the collation sequence set by this opcode is not available ** publicly, only to user functions defined in func.c. */ case OP_CollSeq: { assert( pOp->p4type==P4_COLLSEQ ); - if( pOp->p1 ){ - sqlite3VdbeMemSetInt64(&aMem[pOp->p1], 0); - } break; } /* Opcode: Function P1 P2 P3 P4 P5 ** @@ -67266,15 +66871,10 @@ ** ** If the OPFLAG_CLEARCACHE bit is set on P5 and P1 is a pseudo-table cursor, ** then the cache of the cursor is reset prior to extracting the column. ** The first OP_Column against a pseudo-table after the value of the content ** register has changed should have this bit set. -** -** If the OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG bits are set on P5 when -** the result is guaranteed to only be used as the argument of a length() -** or typeof() function, respectively. The loading of large blobs can be -** skipped for length() and all content loading can be skipped for typeof(). */ case OP_Column: { #if 0 /* local variables moved into u.an */ u32 payloadSize; /* Number of bytes in the record */ i64 payloadSize64; /* Number of bytes in the record */ @@ -67413,11 +67013,11 @@ u.an.pC->aRow = (u8*)u.an.zData; }else{ u.an.pC->aRow = 0; } } - /* The following assert is true in all cases except when + /* The following assert is true in all cases accept when ** the database file has been corrupted externally. ** assert( u.an.zRec!=0 || u.an.avail>=u.an.payloadSize || u.an.avail>=9 ); */ u.an.szHdr = getVarint32((u8*)u.an.zData, u.an.offset); /* Make sure a corrupt database has not given us an oversize header. @@ -67488,15 +67088,15 @@ if( u.an.offsetp5 & (OPFLAG_LENGTHARG|OPFLAG_TYPEOFARG))!=0 - && ((u.an.t>=12 && (u.an.t&1)==0) || (pOp->p5 & OPFLAG_TYPEOFARG)!=0) - ){ - /* Content is irrelevant for the typeof() function and for - ** the length(X) function if X is a blob. So we might as well use - ** bogus content rather than reading content from disk. NULL works - ** for text and blob and whatever is in the u.an.payloadSize64 variable - ** will work for everything else. */ - u.an.zData = u.an.t<12 ? (char*)&u.an.payloadSize64 : 0; - }else{ - u.an.len = sqlite3VdbeSerialTypeLen(u.an.t); - sqlite3VdbeMemMove(&u.an.sMem, u.an.pDest); - rc = sqlite3VdbeMemFromBtree(u.an.pCrsr, u.an.aOffset[u.an.p2], u.an.len, u.an.pC->isIndex, - &u.an.sMem); - if( rc!=SQLITE_OK ){ - goto op_column_out; - } - u.an.zData = u.an.sMem.z; - } - sqlite3VdbeSerialGet((u8*)u.an.zData, u.an.t, u.an.pDest); + u.an.len = sqlite3VdbeSerialTypeLen(u.an.aType[u.an.p2]); + sqlite3VdbeMemMove(&u.an.sMem, u.an.pDest); + rc = sqlite3VdbeMemFromBtree(u.an.pCrsr, u.an.aOffset[u.an.p2], u.an.len, u.an.pC->isIndex, &u.an.sMem); + if( rc!=SQLITE_OK ){ + goto op_column_out; + } + u.an.zData = u.an.sMem.z; + sqlite3VdbeSerialGet((u8*)u.an.zData, u.an.aType[u.an.p2], u.an.pDest); } u.an.pDest->enc = encoding; }else{ if( pOp->p4type==P4_MEM ){ sqlite3VdbeMemShallowCopy(u.an.pDest, pOp->p4.pMem, MEM_Static); @@ -67853,16 +67438,20 @@ u.ar.iSavepoint++; } if( !u.ar.pSavepoint ){ sqlite3SetString(&p->zErrMsg, db, "no such savepoint: %s", u.ar.zName); rc = SQLITE_ERROR; - }else if( db->writeVdbeCnt>0 && u.ar.p1==SAVEPOINT_RELEASE ){ + }else if( + db->writeVdbeCnt>0 || (u.ar.p1==SAVEPOINT_ROLLBACK && db->activeVdbeCnt>1) + ){ /* It is not possible to release (commit) a savepoint if there are - ** active write statements. + ** active write statements. It is not possible to rollback a savepoint + ** if there are any active statements at all. */ sqlite3SetString(&p->zErrMsg, db, - "cannot release savepoint - SQL statements in progress" + "cannot %s savepoint - SQL statements in progress", + (u.ar.p1==SAVEPOINT_ROLLBACK ? "rollback": "release") ); rc = SQLITE_BUSY; }else{ /* Determine whether or not this is a transaction savepoint. If so, @@ -67883,15 +67472,10 @@ } db->isTransactionSavepoint = 0; rc = p->rc; }else{ u.ar.iSavepoint = db->nSavepoint - u.ar.iSavepoint - 1; - if( u.ar.p1==SAVEPOINT_ROLLBACK ){ - for(u.ar.ii=0; u.ar.iinDb; u.ar.ii++){ - sqlite3BtreeTripAllCursors(db->aDb[u.ar.ii].pBt, SQLITE_ABORT); - } - } for(u.ar.ii=0; u.ar.iinDb; u.ar.ii++){ rc = sqlite3BtreeSavepoint(db->aDb[u.ar.ii].pBt, u.ar.p1, u.ar.iSavepoint); if( rc!=SQLITE_OK ){ goto abort_due_to_error; } @@ -67958,32 +67542,29 @@ u.as.turnOnAC = u.as.desiredAutoCommit && !db->autoCommit; assert( u.as.desiredAutoCommit==1 || u.as.desiredAutoCommit==0 ); assert( u.as.desiredAutoCommit==1 || u.as.iRollback==0 ); assert( db->activeVdbeCnt>0 ); /* At least this one VM is active */ -#if 0 if( u.as.turnOnAC && u.as.iRollback && db->activeVdbeCnt>1 ){ /* If this instruction implements a ROLLBACK and other VMs are ** still running, and a transaction is active, return an error indicating ** that the other VMs must complete first. */ sqlite3SetString(&p->zErrMsg, db, "cannot rollback transaction - " "SQL statements in progress"); rc = SQLITE_BUSY; - }else -#endif - if( u.as.turnOnAC && !u.as.iRollback && db->writeVdbeCnt>0 ){ + }else if( u.as.turnOnAC && !u.as.iRollback && db->writeVdbeCnt>0 ){ /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ sqlite3SetString(&p->zErrMsg, db, "cannot commit transaction - " "SQL statements in progress"); rc = SQLITE_BUSY; }else if( u.as.desiredAutoCommit!=db->autoCommit ){ if( u.as.iRollback ){ assert( u.as.desiredAutoCommit==1 ); - sqlite3RollbackAll(db, SQLITE_ABORT_ROLLBACK); + sqlite3RollbackAll(db); db->autoCommit = 1; }else if( (rc = sqlite3VdbeCheckFk(p, 1))!=SQLITE_OK ){ goto vdbe_return; }else{ db->autoCommit = (u8)u.as.desiredAutoCommit; @@ -68035,11 +67616,11 @@ ** If a write-transaction is started and the Vdbe.usesStmtJournal flag is ** true (this flag is set if the Vdbe may modify more than one row and may ** throw an ABORT exception), a statement transaction may also be opened. ** More specifically, a statement transaction is opened iff the database ** connection is currently not in autocommit mode, or if there are other -** active statements. A statement transaction allows the changes made by this +** active statements. A statement transaction allows the affects of this ** VDBE to be rolled back after an error without having to roll back the ** entire transaction. If no error is encountered, the statement transaction ** will automatically commit when the VDBE halts. ** ** If P2 is zero, then a read-lock is obtained on the database file. @@ -69045,11 +68626,11 @@ u.bg.v = 1; /* IMP: R-61914-48074 */ }else{ assert( sqlite3BtreeCursorIsValid(u.bg.pC->pCursor) ); rc = sqlite3BtreeKeySize(u.bg.pC->pCursor, &u.bg.v); assert( rc==SQLITE_OK ); /* Cannot fail following BtreeLast() */ - if( u.bg.v>=MAX_ROWID ){ + if( u.bg.v==MAX_ROWID ){ u.bg.pC->useRandomRowid = 1; }else{ u.bg.v++; /* IMP: R-29538-34987 */ } } @@ -70079,11 +69660,10 @@ if( rc==SQLITE_OK ) rc = u.by.initData.rc; sqlite3DbFree(db, u.by.zSql); db->init.busy = 0; } } - if( rc ) sqlite3ResetInternalSchema(db, -1); if( rc==SQLITE_NOMEM ){ goto no_mem; } break; } @@ -70422,10 +70002,11 @@ p->apCsr = (VdbeCursor **)&aMem[p->nMem+1]; p->aOp = aOp = u.cc.pProgram->aOp; p->nOp = u.cc.pProgram->nOp; p->aOnceFlag = (u8 *)&p->apCsr[p->nCursor]; p->nOnceFlag = u.cc.pProgram->nOnce; + p->nOp = u.cc.pProgram->nOp; pc = -1; memset(p->aOnceFlag, 0, p->nOnceFlag); break; } @@ -70616,11 +70197,10 @@ u.cf.ctx.s.zMalloc = 0; u.cf.ctx.s.xDel = 0; u.cf.ctx.s.db = db; u.cf.ctx.isError = 0; u.cf.ctx.pColl = 0; - u.cf.ctx.skipFlag = 0; if( u.cf.ctx.pFunc->flags & SQLITE_FUNC_NEEDCOLL ){ assert( pOp>p->aOp ); assert( pOp[-1].p4type==P4_COLLSEQ ); assert( pOp[-1].opcode==OP_CollSeq ); u.cf.ctx.pColl = pOp[-1].p4.pColl; @@ -70628,15 +70208,10 @@ (u.cf.ctx.pFunc->xStep)(&u.cf.ctx, u.cf.n, u.cf.apVal); /* IMP: R-24505-23230 */ if( u.cf.ctx.isError ){ sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(&u.cf.ctx.s)); rc = u.cf.ctx.isError; } - if( u.cf.ctx.skipFlag ){ - assert( pOp[-1].opcode==OP_CollSeq ); - u.cf.i = pOp[-1].p1; - if( u.cf.i ) sqlite3VdbeMemSetInt64(&aMem[u.cf.i], 1); - } sqlite3VdbeMemRelease(&u.cf.ctx.s); break; } @@ -72026,21 +71601,21 @@ ** In other words, each time we advance to the next sorter element, log2(N) ** key comparison operations are required, where N is the number of segments ** being merged (rounded up to the next power of 2). */ struct VdbeSorter { - i64 iWriteOff; /* Current write offset within file pTemp1 */ - i64 iReadOff; /* Current read offset within file pTemp1 */ int nInMemory; /* Current size of pRecord list as PMA */ int nTree; /* Used size of aTree/aIter (power of 2) */ - int nPMA; /* Number of PMAs stored in pTemp1 */ - int mnPmaSize; /* Minimum PMA size, in bytes */ - int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */ VdbeSorterIter *aIter; /* Array of iterators to merge */ int *aTree; /* Current state of incremental merge */ + i64 iWriteOff; /* Current write offset within file pTemp1 */ + i64 iReadOff; /* Current read offset within file pTemp1 */ sqlite3_file *pTemp1; /* PMA file 1 */ + int nPMA; /* Number of PMAs stored in pTemp1 */ SorterRecord *pRecord; /* Head of in-memory record list */ + int mnPmaSize; /* Minimum PMA size, in bytes */ + int mxPmaSize; /* Maximum PMA size, in bytes. 0==no limit */ UnpackedRecord *pUnpacked; /* Used to unpack keys */ }; /* ** The following type is an iterator for a PMA. It caches the current key in @@ -72047,14 +71622,14 @@ ** variables nKey/aKey. If the iterator is at EOF, pFile==0. */ struct VdbeSorterIter { i64 iReadOff; /* Current read offset */ i64 iEof; /* 1 byte past EOF for this iterator */ - int nAlloc; /* Bytes of space at aAlloc */ - int nKey; /* Number of bytes in key */ sqlite3_file *pFile; /* File iterator is reading from */ + int nAlloc; /* Bytes of space at aAlloc */ u8 *aAlloc; /* Allocated space */ + int nKey; /* Number of bytes in key */ u8 *aKey; /* Pointer to current key */ }; /* ** A structure to store a single record. All in-memory records are connected @@ -73989,11 +73564,11 @@ assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); zId = pExpr->u.zToken; nId = sqlite3Strlen30(zId); pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0); if( pDef==0 ){ - pDef = sqlite3FindFunction(pParse->db, zId, nId, -2, enc, 0); + pDef = sqlite3FindFunction(pParse->db, zId, nId, -1, enc, 0); if( pDef==0 ){ no_such_func = 1; }else{ wrong_num_args = 1; } @@ -74339,11 +73914,11 @@ NameContext *pNC, /* The name context of the SELECT statement */ Select *pSelect, /* The SELECT statement holding pOrderBy */ ExprList *pOrderBy, /* An ORDER BY or GROUP BY clause to resolve */ const char *zType /* Either "ORDER" or "GROUP", as appropriate */ ){ - int i, j; /* Loop counters */ + int i; /* Loop counter */ int iCol; /* Column number */ struct ExprList_item *pItem; /* A term of the ORDER BY clause */ Parse *pParse; /* Parsing context */ int nResult; /* Number of terms in the result set */ @@ -74376,15 +73951,10 @@ /* Otherwise, treat the ORDER BY term as an ordinary expression */ pItem->iOrderByCol = 0; if( sqlite3ResolveExprNames(pNC, pE) ){ return 1; } - for(j=0; jpEList->nExpr; j++){ - if( sqlite3ExprCompare(pE, pSelect->pEList->a[j].pExpr)==0 ){ - pItem->iOrderByCol = j+1; - } - } } return sqlite3ResolveOrderGroupBy(pParse, pSelect, pOrderBy, zType); } /* @@ -75170,59 +74740,27 @@ int op, /* Expression opcode */ Expr *pLeft, /* Left operand */ Expr *pRight, /* Right operand */ const Token *pToken /* Argument token */ ){ - Expr *p; - if( op==TK_AND && pLeft && pRight ){ - /* Take advantage of short-circuit false optimization for AND */ - p = sqlite3ExprAnd(pParse->db, pLeft, pRight); - }else{ - p = sqlite3ExprAlloc(pParse->db, op, pToken, 1); - sqlite3ExprAttachSubtrees(pParse->db, p, pLeft, pRight); - } + Expr *p = sqlite3ExprAlloc(pParse->db, op, pToken, 1); + sqlite3ExprAttachSubtrees(pParse->db, p, pLeft, pRight); if( p ) { sqlite3ExprCheckHeight(pParse, p->nHeight); } return p; } -/* -** Return 1 if an expression must be FALSE in all cases and 0 if the -** expression might be true. This is an optimization. If is OK to -** return 0 here even if the expression really is always false (a -** false negative). But it is a bug to return 1 if the expression -** might be true in some rare circumstances (a false positive.) -** -** Note that if the expression is part of conditional for a -** LEFT JOIN, then we cannot determine at compile-time whether or not -** is it true or false, so always return 0. -*/ -static int exprAlwaysFalse(Expr *p){ - int v = 0; - if( ExprHasProperty(p, EP_FromJoin) ) return 0; - if( !sqlite3ExprIsInteger(p, &v) ) return 0; - return v==0; -} - /* ** Join two expressions using an AND operator. If either expression is ** NULL, then just return the other expression. -** -** If one side or the other of the AND is known to be false, then instead -** of returning an AND expression, just return a constant expression with -** a value of false. */ SQLITE_PRIVATE Expr *sqlite3ExprAnd(sqlite3 *db, Expr *pLeft, Expr *pRight){ if( pLeft==0 ){ return pRight; }else if( pRight==0 ){ return pLeft; - }else if( exprAlwaysFalse(pLeft) || exprAlwaysFalse(pRight) ){ - sqlite3ExprDelete(db, pLeft); - sqlite3ExprDelete(db, pRight); - return sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0); }else{ Expr *pNew = sqlite3ExprAlloc(db, TK_AND, 0, 0); sqlite3ExprAttachSubtrees(db, pNew, pLeft, pRight); return pNew; } @@ -75574,13 +75112,12 @@ int i; if( p==0 ) return 0; pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); if( pNew==0 ) return 0; pNew->iECursor = 0; - pNew->nExpr = i = p->nExpr; - if( (flags & EXPRDUP_REDUCE)==0 ) for(i=1; inExpr; i+=i){} - pNew->a = pItem = sqlite3DbMallocRaw(db, i*sizeof(p->a[0]) ); + pNew->nExpr = pNew->nAlloc = p->nExpr; + pNew->a = pItem = sqlite3DbMallocRaw(db, p->nExpr*sizeof(p->a[0]) ); if( pItem==0 ){ sqlite3DbFree(db, pNew); return 0; } pOldItem = p->a; @@ -75644,19 +75181,16 @@ IdList *pNew; int i; if( p==0 ) return 0; pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); if( pNew==0 ) return 0; - pNew->nId = p->nId; + pNew->nId = pNew->nAlloc = p->nId; pNew->a = sqlite3DbMallocRaw(db, p->nId*sizeof(p->a[0]) ); if( pNew->a==0 ){ sqlite3DbFree(db, pNew); return 0; } - /* Note that because the size of the allocation for p->a[] is not - ** necessarily a power of two, sqlite3IdListAppend() may not be called - ** on the duplicate created by this function. */ for(i=0; inId; i++){ struct IdList_item *pNewItem = &pNew->a[i]; struct IdList_item *pOldItem = &p->a[i]; pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName); pNewItem->idx = pOldItem->idx; @@ -75714,20 +75248,21 @@ if( pList==0 ){ pList = sqlite3DbMallocZero(db, sizeof(ExprList) ); if( pList==0 ){ goto no_mem; } - pList->a = sqlite3DbMallocRaw(db, sizeof(pList->a[0])); - if( pList->a==0 ) goto no_mem; - }else if( (pList->nExpr & (pList->nExpr-1))==0 ){ + assert( pList->nAlloc==0 ); + } + if( pList->nAlloc<=pList->nExpr ){ struct ExprList_item *a; - assert( pList->nExpr>0 ); - a = sqlite3DbRealloc(db, pList->a, pList->nExpr*2*sizeof(pList->a[0])); + int n = pList->nAlloc*2 + 4; + a = sqlite3DbRealloc(db, pList->a, n*sizeof(pList->a[0])); if( a==0 ){ goto no_mem; } pList->a = a; + pList->nAlloc = sqlite3DbMallocSize(db, a)/sizeof(a[0]); } assert( pList->a!=0 ); if( 1 ){ struct ExprList_item *pItem = &pList->a[pList->nExpr++]; memset(pItem, 0, sizeof(*pItem)); @@ -75814,11 +75349,12 @@ */ SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){ int i; struct ExprList_item *pItem; if( pList==0 ) return; - assert( pList->a!=0 || pList->nExpr==0 ); + assert( pList->a!=0 || (pList->nExpr==0 && pList->nAlloc==0) ); + assert( pList->nExpr<=pList->nAlloc ); for(pItem=pList->a, i=0; inExpr; i++, pItem++){ sqlite3ExprDelete(db, pItem->pExpr); sqlite3DbFree(db, pItem->zName); sqlite3DbFree(db, pItem->zSpan); } @@ -76750,10 +76286,19 @@ ** Actually, the way the column cache is currently used, we are guaranteed ** that the object will never already be in cache. Verify this guarantee. */ #ifndef NDEBUG for(i=0, p=pParse->aColCache; iiReg && p->iTable==iTab && p->iColumn==iCol ){ + cacheEntryClear(pParse, p); + p->iLevel = pParse->iCacheLevel; + p->iReg = iReg; + p->lru = pParse->iCacheCnt++; + return; + } +#endif assert( p->iReg==0 || p->iTable!=iTab || p->iColumn!=iCol ); } #endif /* Find an empty slot and replace it */ @@ -76884,12 +76429,11 @@ SQLITE_PRIVATE int sqlite3ExprCodeGetColumn( Parse *pParse, /* Parsing and code generating context */ Table *pTab, /* Description of the table we are reading from */ int iColumn, /* Index of the table column */ int iTable, /* The cursor pointing to the table */ - int iReg, /* Store results here */ - u8 p5 /* P5 value for OP_Column */ + int iReg /* Store results here */ ){ Vdbe *v = pParse->pVdbe; int i; struct yColCache *p; @@ -76900,15 +76444,11 @@ return p->iReg; } } assert( v!=0 ); sqlite3ExprCodeGetColumnOfTable(v, pTab, iTable, iColumn, iReg); - if( p5 ){ - sqlite3VdbeChangeP5(v, p5); - }else{ - sqlite3ExprCacheStore(pParse, iTable, iColumn, iReg); - } + sqlite3ExprCacheStore(pParse, iTable, iColumn, iReg); return iReg; } /* ** Clear all column cache entries. @@ -77032,12 +76572,11 @@ /* This only happens when coding check constraints */ assert( pParse->ckBase>0 ); inReg = pExpr->iColumn + pParse->ckBase; }else{ inReg = sqlite3ExprCodeGetColumn(pParse, pExpr->pTab, - pExpr->iColumn, pExpr->iTable, target, - pExpr->op2); + pExpr->iColumn, pExpr->iTable, target); } break; } case TK_INTEGER: { codeInteger(pParse, pExpr, 0, target); @@ -77310,29 +76849,10 @@ } if( pFarg ){ r1 = sqlite3GetTempRange(pParse, nFarg); - - /* For length() and typeof() functions with a column argument, - ** set the P5 parameter to the OP_Column opcode to OPFLAG_LENGTHARG - ** or OPFLAG_TYPEOFARG respectively, to avoid unnecessary data - ** loading. - */ - if( (pDef->flags & (SQLITE_FUNC_LENGTH|SQLITE_FUNC_TYPEOF))!=0 ){ - u8 exprOp; - assert( nFarg==1 ); - assert( pFarg->a[0].pExpr!=0 ); - exprOp = pFarg->a[0].pExpr->op; - if( exprOp==TK_COLUMN || exprOp==TK_AGG_COLUMN ){ - assert( SQLITE_FUNC_LENGTH==OPFLAG_LENGTHARG ); - assert( SQLITE_FUNC_TYPEOF==OPFLAG_TYPEOFARG ); - testcase( pDef->flags==SQLITE_FUNC_LENGTH ); - pFarg->a[0].pExpr->op2 = pDef->flags; - } - } - sqlite3ExprCachePush(pParse); /* Ticket 2ea2425d34be */ sqlite3ExprCodeExprList(pParse, pFarg, r1, 1); sqlite3ExprCachePop(pParse, 1); /* Ticket 2ea2425d34be */ }else{ r1 = 0; @@ -78464,11 +77984,11 @@ if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 2; if( ExprHasProperty(pA, EP_IntValue) ){ if( !ExprHasProperty(pB, EP_IntValue) || pA->u.iValue!=pB->u.iValue ){ return 2; } - }else if( pA->op!=TK_COLUMN && pA->op!=TK_AGG_COLUMN && pA->u.zToken ){ + }else if( pA->op!=TK_COLUMN && pA->u.zToken ){ if( ExprHasProperty(pB, EP_IntValue) || NEVER(pB->u.zToken==0) ) return 2; if( strcmp(pA->u.zToken,pB->u.zToken)!=0 ){ return 2; } } @@ -78501,45 +78021,10 @@ if( sqlite3ExprCompare(pExprA, pExprB) ) return 1; } return 0; } -/* -** This is the expression callback for sqlite3FunctionUsesOtherSrc(). -** -** Determine if an expression references any table other than one of the -** tables in pWalker->u.pSrcList and abort if it does. -*/ -static int exprUsesOtherSrc(Walker *pWalker, Expr *pExpr){ - if( pExpr->op==TK_COLUMN || pExpr->op==TK_AGG_COLUMN ){ - int i; - SrcList *pSrc = pWalker->u.pSrcList; - for(i=0; inSrc; i++){ - if( pExpr->iTable==pSrc->a[i].iCursor ) return WRC_Continue; - } - return WRC_Abort; - }else{ - return WRC_Continue; - } -} - -/* -** Determine if any of the arguments to the pExpr Function references -** any SrcList other than pSrcList. Return true if they do. Return -** false if pExpr has no argument or has only constant arguments or -** only references tables named in pSrcList. -*/ -static int sqlite3FunctionUsesOtherSrc(Expr *pExpr, SrcList *pSrcList){ - Walker w; - assert( pExpr->op==TK_AGG_FUNCTION ); - memset(&w, 0, sizeof(w)); - w.xExprCallback = exprUsesOtherSrc; - w.u.pSrcList = pSrcList; - if( sqlite3WalkExprList(&w, pExpr->x.pList)!=WRC_Continue ) return 1; - return 0; -} - /* ** Add a new element to the pAggInfo->aCol[] array. Return the index of ** the new element. Return a negative number if malloc fails. */ static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ @@ -78546,11 +78031,13 @@ int i; pInfo->aCol = sqlite3ArrayAllocate( db, pInfo->aCol, sizeof(pInfo->aCol[0]), + 3, &pInfo->nColumn, + &pInfo->nColumnAlloc, &i ); return i; } @@ -78562,11 +78049,13 @@ int i; pInfo->aFunc = sqlite3ArrayAllocate( db, pInfo->aFunc, sizeof(pInfo->aFunc[0]), + 3, &pInfo->nFunc, + &pInfo->nFuncAlloc, &i ); return i; } @@ -78651,11 +78140,13 @@ } /* end loop over pSrcList */ } return WRC_Prune; } case TK_AGG_FUNCTION: { - if( !sqlite3FunctionUsesOtherSrc(pExpr, pSrcList) ){ + /* The pNC->nDepth==0 test causes aggregate functions in subqueries + ** to be ignored */ + if( pNC->nDepth==0 ){ /* Check to see if pExpr is a duplicate of another aggregate ** function that is already in the pAggInfo structure */ struct AggInfo_func *pItem = pAggInfo->aFunc; for(i=0; inFunc; i++, pItem++){ @@ -78695,13 +78186,19 @@ } } return WRC_Continue; } static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){ - UNUSED_PARAMETER(pWalker); - UNUSED_PARAMETER(pSelect); - return WRC_Continue; + NameContext *pNC = pWalker->u.pNC; + if( pNC->nDepth==0 ){ + pNC->nDepth++; + sqlite3WalkSelect(pWalker, pSelect); + pNC->nDepth--; + return WRC_Prune; + }else{ + return WRC_Continue; + } } /* ** Analyze the given expression looking for aggregate functions and ** for variables that need to be added to the pParse->aAgg[] array. @@ -78710,11 +78207,10 @@ ** This routine should only be called after the expression has been ** analyzed by sqlite3ResolveExprNames(). */ SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){ Walker w; - memset(&w, 0, sizeof(w)); w.xExprCallback = analyzeAggregate; w.xSelectCallback = analyzeAggregatesInSelect; w.u.pNC = pNC; assert( pNC->pSrcList!=0 ); sqlite3WalkExpr(&w, pExpr); @@ -79332,11 +78828,11 @@ "name = CASE " "WHEN type='table' THEN %Q " "WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN " "'sqlite_autoindex_' || %Q || substr(name,%d+18) " "ELSE name END " - "WHERE tbl_name=%Q COLLATE nocase AND " + "WHERE tbl_name=%Q AND " "(type='table' OR type='index' OR type='trigger');", zDb, SCHEMA_TABLE(iDb), zName, zName, zName, #ifndef SQLITE_OMIT_TRIGGER zName, #endif @@ -80562,11 +80058,10 @@ Index *pPrevIdx = 0; /* Previous index in the loop */ int idx = 0; /* slot in pIdx->aSample[] for next sample */ int eType; /* Datatype of a sample */ IndexSample *pSample; /* A slot in pIdx->aSample[] */ - assert( db->lookaside.bEnabled==0 ); if( !sqlite3FindTable(db, "sqlite_stat3", zDb) ){ return SQLITE_OK; } zSql = sqlite3MPrintf(db, @@ -80589,11 +80084,11 @@ nSample = sqlite3_column_int(pStmt, 1); pIdx = sqlite3FindIndex(db, zIndex, zDb); if( pIdx==0 ) continue; assert( pIdx->nSample==0 ); pIdx->nSample = nSample; - pIdx->aSample = sqlite3DbMallocZero(db, nSample*sizeof(IndexSample)); + pIdx->aSample = sqlite3MallocZero( nSample*sizeof(IndexSample) ); pIdx->avgEq = pIdx->aiRowEst[1]; if( pIdx->aSample==0 ){ db->mallocFailed = 1; sqlite3_finalize(pStmt); return SQLITE_NOMEM; @@ -80662,11 +80157,11 @@ int n = z ? sqlite3_column_bytes(pStmt, 4) : 0; pSample->nByte = n; if( n < 1){ pSample->u.z = 0; }else{ - pSample->u.z = sqlite3DbMallocRaw(db, n); + pSample->u.z = sqlite3Malloc(n); if( pSample->u.z==0 ){ db->mallocFailed = 1; sqlite3_finalize(pStmt); return SQLITE_NOMEM; } @@ -80738,14 +80233,11 @@ /* Load the statistics from the sqlite_stat3 table. */ #ifdef SQLITE_ENABLE_STAT3 if( rc==SQLITE_OK ){ - int lookasideEnabled = db->lookaside.bEnabled; - db->lookaside.bEnabled = 0; rc = loadStat3(db, sInfo.zDatabase); - db->lookaside.bEnabled = lookasideEnabled; } #endif if( rc==SQLITE_NOMEM ){ db->mallocFailed = 1; @@ -82104,11 +81596,11 @@ sqliteDeleteColumnNames(db, pTable); sqlite3DbFree(db, pTable->zName); sqlite3DbFree(db, pTable->zColAff); sqlite3SelectDelete(db, pTable->pSelect); #ifndef SQLITE_OMIT_CHECK - sqlite3ExprListDelete(db, pTable->pCheck); + sqlite3ExprDelete(db, pTable->pCheck); #endif #ifndef SQLITE_OMIT_VIRTUALTABLE sqlite3VtabClear(db, pTable); #endif sqlite3DbFree(db, pTable); @@ -82767,21 +82259,19 @@ */ SQLITE_PRIVATE void sqlite3AddCheckConstraint( Parse *pParse, /* Parsing context */ Expr *pCheckExpr /* The check expression */ ){ + sqlite3 *db = pParse->db; #ifndef SQLITE_OMIT_CHECK Table *pTab = pParse->pNewTable; if( pTab && !IN_DECLARE_VTAB ){ - pTab->pCheck = sqlite3ExprListAppend(pParse, pTab->pCheck, pCheckExpr); - if( pParse->constraintName.n ){ - sqlite3ExprListSetName(pParse, pTab->pCheck, &pParse->constraintName, 1); - } + pTab->pCheck = sqlite3ExprAnd(db, pTab->pCheck, pCheckExpr); }else #endif { - sqlite3ExprDelete(pParse->db, pCheckExpr); + sqlite3ExprDelete(db, pCheckExpr); } } /* ** Set the collation function of the most recently parsed table column @@ -83047,12 +82537,10 @@ /* Resolve names in all CHECK constraint expressions. */ if( p->pCheck ){ SrcList sSrc; /* Fake SrcList for pParse->pNewTable */ NameContext sNC; /* Name context for pParse->pNewTable */ - ExprList *pList; /* List of all CHECK constraints */ - int i; /* Loop counter */ memset(&sNC, 0, sizeof(sNC)); memset(&sSrc, 0, sizeof(sSrc)); sSrc.nSrc = 1; sSrc.a[0].zName = p->zName; @@ -83059,15 +82547,12 @@ sSrc.a[0].pTab = p; sSrc.a[0].iCursor = -1; sNC.pParse = pParse; sNC.pSrcList = &sSrc; sNC.isCheck = 1; - pList = p->pCheck; - for(i=0; inExpr; i++){ - if( sqlite3ResolveExprNames(&sNC, pList->a[i].pExpr) ){ - return; - } + if( sqlite3ResolveExprNames(&sNC, p->pCheck) ){ + return; } } #endif /* !defined(SQLITE_OMIT_CHECK) */ /* If the db->init.busy is 1 it means we are reading the SQL off the @@ -83212,10 +82697,11 @@ assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ db->mallocFailed = 1; return; } pParse->pNewTable = 0; + db->nTable++; db->flags |= SQLITE_InternChanges; #ifndef SQLITE_OMIT_ALTERTABLE if( !p->pSelect ){ const char *zName = (const char *)pParse->sNameToken.z; @@ -84614,47 +84100,49 @@ exit_drop_index: sqlite3SrcListDelete(db, pName); } /* -** pArray is a pointer to an array of objects. Each object in the -** array is szEntry bytes in size. This routine uses sqlite3DbRealloc() -** to extend the array so that there is space for a new object at the end. -** -** When this function is called, *pnEntry contains the current size of -** the array (in entries - so the allocation is ((*pnEntry) * szEntry) bytes -** in total). -** -** If the realloc() is successful (i.e. if no OOM condition occurs), the -** space allocated for the new object is zeroed, *pnEntry updated to -** reflect the new size of the array and a pointer to the new allocation -** returned. *pIdx is set to the index of the new array entry in this case. -** -** Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains -** unchanged and a copy of pArray returned. +** pArray is a pointer to an array of objects. Each object in the +** array is szEntry bytes in size. This routine allocates a new +** object on the end of the array. +** +** *pnEntry is the number of entries already in use. *pnAlloc is +** the previously allocated size of the array. initSize is the +** suggested initial array size allocation. +** +** The index of the new entry is returned in *pIdx. +** +** This routine returns a pointer to the array of objects. This +** might be the same as the pArray parameter or it might be a different +** pointer if the array was resized. */ SQLITE_PRIVATE void *sqlite3ArrayAllocate( sqlite3 *db, /* Connection to notify of malloc failures */ void *pArray, /* Array of objects. Might be reallocated */ int szEntry, /* Size of each object in the array */ + int initSize, /* Suggested initial allocation, in elements */ int *pnEntry, /* Number of objects currently in use */ + int *pnAlloc, /* Current size of the allocation, in elements */ int *pIdx /* Write the index of a new slot here */ ){ char *z; - int n = *pnEntry; - if( (n & (n-1))==0 ){ - int sz = (n==0) ? 1 : 2*n; - void *pNew = sqlite3DbRealloc(db, pArray, sz*szEntry); + if( *pnEntry >= *pnAlloc ){ + void *pNew; + int newSize; + newSize = (*pnAlloc)*2 + initSize; + pNew = sqlite3DbRealloc(db, pArray, newSize*szEntry); if( pNew==0 ){ *pIdx = -1; return pArray; } + *pnAlloc = sqlite3DbMallocSize(db, pNew)/szEntry; pArray = pNew; } z = (char*)pArray; - memset(&z[n * szEntry], 0, szEntry); - *pIdx = n; + memset(&z[*pnEntry * szEntry], 0, szEntry); + *pIdx = *pnEntry; ++*pnEntry; return pArray; } /* @@ -84666,16 +84154,19 @@ SQLITE_PRIVATE IdList *sqlite3IdListAppend(sqlite3 *db, IdList *pList, Token *pToken){ int i; if( pList==0 ){ pList = sqlite3DbMallocZero(db, sizeof(IdList) ); if( pList==0 ) return 0; + pList->nAlloc = 0; } pList->a = sqlite3ArrayAllocate( db, pList->a, sizeof(pList->a[0]), + 5, &pList->nId, + &pList->nAlloc, &i ); if( i<0 ){ sqlite3IdListDelete(db, pList); return 0; @@ -85615,61 +85106,42 @@ ** is called to test how well the function passed as the first argument ** matches the request for a function with nArg arguments in a system ** that uses encoding enc. The value returned indicates how well the ** request is matched. A higher value indicates a better match. ** -** If nArg is -1 that means to only return a match (non-zero) if p->nArg -** is also -1. In other words, we are searching for a function that -** takes a variable number of arguments. -** -** If nArg is -2 that means that we are searching for any function -** regardless of the number of arguments it uses, so return a positive -** match score for any -** ** The returned value is always between 0 and 6, as follows: ** -** 0: Not a match. -** 1: UTF8/16 conversion required and function takes any number of arguments. -** 2: UTF16 byte order change required and function takes any number of args. -** 3: encoding matches and function takes any number of arguments -** 4: UTF8/16 conversion required - argument count matches exactly -** 5: UTF16 byte order conversion required - argument count matches exactly -** 6: Perfect match: encoding and argument count match exactly. +** 0: Not a match, or if nArg<0 and the function is has no implementation. +** 1: A variable arguments function that prefers UTF-8 when a UTF-16 +** encoding is requested, or vice versa. +** 2: A variable arguments function that uses UTF-16BE when UTF-16LE is +** requested, or vice versa. +** 3: A variable arguments function using the same text encoding. +** 4: A function with the exact number of arguments requested that +** prefers UTF-8 when a UTF-16 encoding is requested, or vice versa. +** 5: A function with the exact number of arguments requested that +** prefers UTF-16LE when UTF-16BE is requested, or vice versa. +** 6: An exact match. ** -** If nArg==(-2) then any function with a non-null xStep or xFunc is -** a perfect match and any function with both xStep and xFunc NULL is -** a non-match. */ -#define FUNC_PERFECT_MATCH 6 /* The score for a perfect match */ -static int matchQuality( - FuncDef *p, /* The function we are evaluating for match quality */ - int nArg, /* Desired number of arguments. (-1)==any */ - u8 enc /* Desired text encoding */ -){ - int match; - - /* nArg of -2 is a special case */ - if( nArg==(-2) ) return (p->xFunc==0 && p->xStep==0) ? 0 : FUNC_PERFECT_MATCH; - - /* Wrong number of arguments means "no match" */ - if( p->nArg!=nArg && p->nArg>=0 ) return 0; - - /* Give a better score to a function with a specific number of arguments - ** than to function that accepts any number of arguments. */ - if( p->nArg==nArg ){ - match = 4; - }else{ +static int matchQuality(FuncDef *p, int nArg, u8 enc){ + int match = 0; + if( p->nArg==-1 || p->nArg==nArg + || (nArg==-1 && (p->xFunc!=0 || p->xStep!=0)) + ){ match = 1; - } - - /* Bonus points if the text encoding matches */ - if( enc==p->iPrefEnc ){ - match += 2; /* Exact encoding match */ - }else if( (enc & p->iPrefEnc & 2)!=0 ){ - match += 1; /* Both are UTF16, but with different byte orders */ - } - + if( p->nArg==nArg || nArg==-1 ){ + match = 4; + } + if( enc==p->iPrefEnc ){ + match += 2; + } + else if( (enc==SQLITE_UTF16LE && p->iPrefEnc==SQLITE_UTF16BE) || + (enc==SQLITE_UTF16BE && p->iPrefEnc==SQLITE_UTF16LE) ){ + match += 1; + } + } return match; } /* ** Search a FuncDefHash for a function with the given name. Return @@ -85721,16 +85193,17 @@ ** pointer to the FuncDef structure that defines that function, or return ** NULL if the function does not exist. ** ** If the createFlag argument is true, then a new (blank) FuncDef ** structure is created and liked into the "db" structure if a -** no matching function previously existed. +** no matching function previously existed. When createFlag is true +** and the nArg parameter is -1, then only a function that accepts +** any number of arguments will be returned. ** -** If nArg is -2, then the first valid function found is returned. A -** function is valid if either xFunc or xStep is non-zero. The nArg==(-2) -** case is used to see if zName is a valid function name for some number -** of arguments. If nArg is -2, then createFlag must be 0. +** If createFlag is false and nArg is -1, then the first valid +** function found is returned. A function is valid if either xFunc +** or xStep is non-zero. ** ** If createFlag is false, then a function with the required name and ** number of arguments may be returned even if the eTextRep flag does not ** match that requested. */ @@ -85738,19 +85211,18 @@ sqlite3 *db, /* An open database */ const char *zName, /* Name of the function. Not null-terminated */ int nName, /* Number of characters in the name */ int nArg, /* Number of arguments. -1 means any number */ u8 enc, /* Preferred text encoding */ - u8 createFlag /* Create new entry if true and does not otherwise exist */ + int createFlag /* Create new entry if true and does not otherwise exist */ ){ FuncDef *p; /* Iterator variable */ FuncDef *pBest = 0; /* Best match found so far */ int bestScore = 0; /* Score of best match */ int h; /* Hash value */ - assert( nArg>=(-2) ); - assert( nArg>=(-1) || createFlag==0 ); + assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE ); h = (sqlite3UpperToLower[(u8)zName[0]] + nName) % ArraySize(db->aFunc.a); /* First search for a match amongst the application-defined functions. */ @@ -85792,11 +85264,11 @@ /* If the createFlag parameter is true and the search did not reveal an ** exact match for the name, number of arguments and encoding, then add a ** new entry to the hash table and return it. */ - if( createFlag && bestScorenArg!=nArg) && (pBest = sqlite3DbMallocZero(db, sizeof(*pBest)+nName+1))!=0 ){ pBest->zName = (char *)&pBest[1]; pBest->nArg = (u16)nArg; pBest->iPrefEnc = enc; memcpy(pBest->zName, zName, nName); @@ -86244,11 +85716,11 @@ sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet); pWInfo = sqlite3WhereBegin( pParse, pTabList, pWhere, 0, 0, WHERE_DUPLICATES_OK ); if( pWInfo==0 ) goto delete_from_cleanup; - regRowid = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, iRowid, 0); + regRowid = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, iRowid); sqlite3VdbeAddOp2(v, OP_RowSetAdd, iRowSet, regRowid); if( db->flags & SQLITE_CountRows ){ sqlite3VdbeAddOp2(v, OP_AddImm, memCnt, 1); } sqlite3WhereEnd(pWInfo); @@ -86550,18 +86022,10 @@ */ static CollSeq *sqlite3GetFuncCollSeq(sqlite3_context *context){ return context->pColl; } -/* -** Indicate that the accumulator load should be skipped on this -** iteration of the aggregate loop. -*/ -static void sqlite3SkipAccumulatorLoad(sqlite3_context *context){ - context->skipFlag = 1; -} - /* ** Implementation of the non-aggregate min() and max() functions */ static void minmaxFunc( sqlite3_context *context, @@ -86938,11 +86402,11 @@ ** in a way that is testable, mask the sign bit off of negative ** values, resulting in a positive value. Then take the ** 2s complement of that positive value. The end result can ** therefore be no less than -9223372036854775807. */ - r = -(r & LARGEST_INT64); + r = -(r ^ (((sqlite3_int64)1)<<63)); } sqlite3_result_int64(context, r); } /* @@ -87864,16 +87328,15 @@ ){ Mem *pArg = (Mem *)argv[0]; Mem *pBest; UNUSED_PARAMETER(NotUsed); + if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest)); if( !pBest ) return; - if( sqlite3_value_type(argv[0])==SQLITE_NULL ){ - if( pBest->flags ) sqlite3SkipAccumulatorLoad(context); - }else if( pBest->flags ){ + if( pBest->flags ){ int max; int cmp; CollSeq *pColl = sqlite3GetFuncCollSeq(context); /* This step function is used for both the min() and max() aggregates, ** the only difference between the two being that the sense of the @@ -87885,22 +87348,20 @@ */ max = sqlite3_user_data(context)!=0; cmp = sqlite3MemCompare(pBest, pArg, pColl); if( (max && cmp<0) || (!max && cmp>0) ){ sqlite3VdbeMemCopy(pBest, pArg); - }else{ - sqlite3SkipAccumulatorLoad(context); } }else{ sqlite3VdbeMemCopy(pBest, pArg); } } static void minMaxFinalize(sqlite3_context *context){ sqlite3_value *pRes; pRes = (sqlite3_value *)sqlite3_aggregate_context(context, 0); if( pRes ){ - if( pRes->flags ){ + if( ALWAYS(pRes->flags) ){ sqlite3_result_value(context, pRes); } sqlite3VdbeMemRelease(pRes); } } @@ -88064,12 +87525,12 @@ FUNCTION(min, 0, 0, 1, 0 ), AGGREGATE(min, 1, 0, 1, minmaxStep, minMaxFinalize ), FUNCTION(max, -1, 1, 1, minmaxFunc ), FUNCTION(max, 0, 1, 1, 0 ), AGGREGATE(max, 1, 1, 1, minmaxStep, minMaxFinalize ), - FUNCTION2(typeof, 1, 0, 0, typeofFunc, SQLITE_FUNC_TYPEOF), - FUNCTION2(length, 1, 0, 0, lengthFunc, SQLITE_FUNC_LENGTH), + FUNCTION(typeof, 1, 0, 0, typeofFunc ), + FUNCTION(length, 1, 0, 0, lengthFunc ), FUNCTION(substr, 2, 0, 0, substrFunc ), FUNCTION(substr, 3, 0, 0, substrFunc ), FUNCTION(abs, 1, 0, 0, absFunc ), #ifndef SQLITE_OMIT_FLOATING_POINT FUNCTION(round, 1, 0, 0, roundFunc ), @@ -88077,13 +87538,15 @@ #endif FUNCTION(upper, 1, 0, 0, upperFunc ), FUNCTION(lower, 1, 0, 0, lowerFunc ), FUNCTION(coalesce, 1, 0, 0, 0 ), FUNCTION(coalesce, 0, 0, 0, 0 ), - FUNCTION2(coalesce, -1, 0, 0, ifnullFunc, SQLITE_FUNC_COALESCE), +/* FUNCTION(coalesce, -1, 0, 0, ifnullFunc ), */ + {-1,SQLITE_UTF8,SQLITE_FUNC_COALESCE,0,0,ifnullFunc,0,0,"coalesce",0,0}, FUNCTION(hex, 1, 0, 0, hexFunc ), - FUNCTION2(ifnull, 2, 0, 0, ifnullFunc, SQLITE_FUNC_COALESCE), +/* FUNCTION(ifnull, 2, 0, 0, ifnullFunc ), */ + {2,SQLITE_UTF8,SQLITE_FUNC_COALESCE,0,0,ifnullFunc,0,0,"ifnull",0,0}, FUNCTION(random, 0, 0, 0, randomFunc ), FUNCTION(randomblob, 1, 0, 0, randomBlob ), FUNCTION(nullif, 2, 0, 1, nullifFunc ), FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), FUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), @@ -90516,15 +89979,13 @@ int j1; /* Addresss of jump instruction */ int j2 = 0, j3; /* Addresses of jump instructions */ int regData; /* Register containing first data column */ int iCur; /* Table cursor number */ Index *pIdx; /* Pointer to one of the indices */ - sqlite3 *db; /* Database connection */ int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */ int regOldRowid = (rowidChng && isUpdate) ? rowidChng : regRowid; - db = pParse->db; v = sqlite3GetVdbe(pParse); assert( v!=0 ); assert( pTab->pSelect==0 ); /* This table is not a VIEW */ nCol = pTab->nCol; regData = regRowid + 1; @@ -90553,11 +90014,11 @@ case OE_Rollback: case OE_Fail: { char *zMsg; sqlite3VdbeAddOp3(v, OP_HaltIfNull, SQLITE_CONSTRAINT, onError, regData+i); - zMsg = sqlite3MPrintf(db, "%s.%s may not be NULL", + zMsg = sqlite3MPrintf(pParse->db, "%s.%s may not be NULL", pTab->zName, pTab->aCol[i].zName); sqlite3VdbeChangeP4(v, -1, zMsg, P4_DYNAMIC); break; } case OE_Ignore: { @@ -90575,31 +90036,22 @@ } /* Test all CHECK constraints */ #ifndef SQLITE_OMIT_CHECK - if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){ - ExprList *pCheck = pTab->pCheck; + if( pTab->pCheck && (pParse->db->flags & SQLITE_IgnoreChecks)==0 ){ + int allOk = sqlite3VdbeMakeLabel(v); pParse->ckBase = regData; + sqlite3ExprIfTrue(pParse, pTab->pCheck, allOk, SQLITE_JUMPIFNULL); onError = overrideError!=OE_Default ? overrideError : OE_Abort; - for(i=0; inExpr; i++){ - int allOk = sqlite3VdbeMakeLabel(v); - sqlite3ExprIfTrue(pParse, pCheck->a[i].pExpr, allOk, SQLITE_JUMPIFNULL); - if( onError==OE_Ignore ){ - sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest); - }else{ - char *zConsName = pCheck->a[i].zName; - if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */ - if( zConsName ){ - zConsName = sqlite3MPrintf(db, "constraint %s failed", zConsName); - }else{ - zConsName = 0; - } - sqlite3HaltConstraint(pParse, onError, zConsName, P4_DYNAMIC); - } - sqlite3VdbeResolveLabel(v, allOk); - } + if( onError==OE_Ignore ){ + sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest); + }else{ + if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */ + sqlite3HaltConstraint(pParse, onError, 0, 0); + } + sqlite3VdbeResolveLabel(v, allOk); } #endif /* !defined(SQLITE_OMIT_CHECK) */ /* If we have an INTEGER PRIMARY KEY, make sure the primary key ** of the new record does not previously exist. Except, if this @@ -90651,11 +90103,11 @@ ** ** to run without a statement journal if there are no indexes on the ** table. */ Trigger *pTrigger = 0; - if( db->flags&SQLITE_RecTriggers ){ + if( pParse->db->flags&SQLITE_RecTriggers ){ pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0); } if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){ sqlite3MultiWrite(pParse); sqlite3GenerateRowDelete( @@ -90740,11 +90192,11 @@ StrAccum errMsg; const char *zSep; char *zErr; sqlite3StrAccumInit(&errMsg, 0, 0, 200); - errMsg.db = db; + errMsg.db = pParse->db; zSep = pIdx->nColumn>1 ? "columns " : "column "; for(j=0; jnColumn; j++){ char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName; sqlite3StrAccumAppend(&errMsg, zSep, -1); zSep = ", "; @@ -90764,11 +90216,11 @@ } default: { Trigger *pTrigger = 0; assert( onError==OE_Replace ); sqlite3MultiWrite(pParse); - if( db->flags&SQLITE_RecTriggers ){ + if( pParse->db->flags&SQLITE_RecTriggers ){ pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0); } sqlite3GenerateRowDelete( pParse, pTab, baseCur, regR, 0, pTrigger, OE_Replace ); @@ -91094,11 +90546,11 @@ if( pSrcIdx==0 ){ return 0; /* pDestIdx has no corresponding index in pSrc */ } } #ifndef SQLITE_OMIT_CHECK - if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck, pDest->pCheck) ){ + if( pDest->pCheck && sqlite3ExprCompare(pSrc->pCheck, pDest->pCheck) ){ return 0; /* Tables have different CHECK constraints. Ticket #2252 */ } #endif #ifndef SQLITE_OMIT_FOREIGN_KEY /* Disallow the transfer optimization if the destination table constains @@ -92487,19 +91939,18 @@ */ /* ** Interpret the given string as a safety level. Return 0 for OFF, ** 1 for ON or NORMAL and 2 for FULL. Return 1 for an empty or -** unrecognized string argument. The FULL option is disallowed -** if the omitFull parameter it 1. +** unrecognized string argument. ** ** Note that the values returned are one less that the values that ** should be passed into sqlite3BtreeSetSafetyLevel(). The is done ** to support legacy SQL code. The safety level used to be boolean ** and older scripts may have used numbers 0 for OFF and 1 for ON. */ -static u8 getSafetyLevel(const char *z, int omitFull, int dflt){ +static u8 getSafetyLevel(const char *z){ /* 123456789 123456789 */ static const char zText[] = "onoffalseyestruefull"; static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16}; static const u8 iLength[] = {2, 2, 3, 5, 3, 4, 4}; static const u8 iValue[] = {1, 0, 0, 0, 1, 1, 2}; @@ -92506,23 +91957,23 @@ int i, n; if( sqlite3Isdigit(*z) ){ return (u8)sqlite3Atoi(z); } n = sqlite3Strlen30(z); - for(i=0; iflags |= mask; }else{ db->flags &= ~mask; } @@ -92783,16 +92235,13 @@ char *zLeft = 0; /* Nul-terminated UTF-8 string */ char *zRight = 0; /* Nul-terminated UTF-8 string , or NULL */ const char *zDb = 0; /* The database name */ Token *pId; /* Pointer to token */ int iDb; /* Database index for */ - char *aFcntl[4]; /* Argument to SQLITE_FCNTL_PRAGMA */ - int rc; /* return value form SQLITE_FCNTL_PRAGMA */ - sqlite3 *db = pParse->db; /* The database connection */ - Db *pDb; /* The specific database being pragmaed */ - Vdbe *v = pParse->pVdbe = sqlite3VdbeCreate(db); /* Prepared statement */ - + sqlite3 *db = pParse->db; + Db *pDb; + Vdbe *v = pParse->pVdbe = sqlite3VdbeCreate(db); if( v==0 ) return; sqlite3VdbeRunOnlyOnce(v); pParse->nMem = 2; /* Interpret the [database.] part of the pragma statement. iDb is the @@ -92819,38 +92268,10 @@ assert( pId2 ); zDb = pId2->n>0 ? pDb->zName : 0; if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){ goto pragma_out; } - - /* Send an SQLITE_FCNTL_PRAGMA file-control to the underlying VFS - ** connection. If it returns SQLITE_OK, then assume that the VFS - ** handled the pragma and generate a no-op prepared statement. - */ - aFcntl[0] = 0; - aFcntl[1] = zLeft; - aFcntl[2] = zRight; - aFcntl[3] = 0; - rc = sqlite3_file_control(db, zDb, SQLITE_FCNTL_PRAGMA, (void*)aFcntl); - if( rc==SQLITE_OK ){ - if( aFcntl[0] ){ - int mem = ++pParse->nMem; - sqlite3VdbeAddOp4(v, OP_String8, 0, mem, 0, aFcntl[0], 0); - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "result", SQLITE_STATIC); - sqlite3VdbeAddOp2(v, OP_ResultRow, mem, 1); - sqlite3_free(aFcntl[0]); - } - }else if( rc!=SQLITE_NOTFOUND ){ - if( aFcntl[0] ){ - sqlite3ErrorMsg(pParse, "%s", aFcntl[0]); - sqlite3_free(aFcntl[0]); - } - pParse->nErr++; - pParse->rc = rc; - }else - #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED) /* ** PRAGMA [database.]default_cache_size ** PRAGMA [database.]default_cache_size=N @@ -92939,11 +92360,11 @@ if( sqlite3StrICmp(zLeft,"secure_delete")==0 ){ Btree *pBt = pDb->pBt; int b = -1; assert( pBt!=0 ); if( zRight ){ - b = sqlite3GetBoolean(zRight, 0); + b = sqlite3GetBoolean(zRight); } if( pId2->n==0 && b>=0 ){ int ii; for(ii=0; iinDb; ii++){ sqlite3BtreeSecureDelete(db->aDb[ii].pBt, b); @@ -93134,11 +92555,11 @@ /* Call SetAutoVacuum() to set initialize the internal auto and ** incr-vacuum flags. This is required in case this connection ** creates the database file. It is important that it is created ** as an auto-vacuum capable db. */ - rc = sqlite3BtreeSetAutoVacuum(pBt, eAuto); + int rc = sqlite3BtreeSetAutoVacuum(pBt, eAuto); if( rc==SQLITE_OK && (eAuto==1 || eAuto==2) ){ /* When setting the auto_vacuum mode to either "full" or ** "incremental", write the value of meta[6] in the database ** file. Before writing to meta[6], check that meta[3] indicates ** that this really is an auto-vacuum capable database. @@ -93252,10 +92673,11 @@ sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); } }else{ #ifndef SQLITE_OMIT_WSD if( zRight[0] ){ + int rc; int res; rc = sqlite3OsAccess(db->pVfs, zRight, SQLITE_ACCESS_READWRITE, &res); if( rc!=SQLITE_OK || res==0 ){ sqlite3ErrorMsg(pParse, "not a writable directory"); goto pragma_out; @@ -93343,11 +92765,11 @@ }else{ if( !db->autoCommit ){ sqlite3ErrorMsg(pParse, "Safety level may not be changed inside a transaction"); }else{ - pDb->safety_level = getSafetyLevel(zRight,0,1)+1; + pDb->safety_level = getSafetyLevel(zRight)+1; } } }else #endif /* SQLITE_OMIT_PAGER_PRAGMAS */ @@ -93542,11 +92964,11 @@ #endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */ #ifndef NDEBUG if( sqlite3StrICmp(zLeft, "parser_trace")==0 ){ if( zRight ){ - if( sqlite3GetBoolean(zRight, 0) ){ + if( sqlite3GetBoolean(zRight) ){ sqlite3ParserTrace(stderr, "parser: "); }else{ sqlite3ParserTrace(0, 0); } } @@ -93556,11 +92978,11 @@ /* Reinstall the LIKE and GLOB functions. The variant of LIKE ** used will be case sensitive or not depending on the RHS. */ if( sqlite3StrICmp(zLeft, "case_sensitive_like")==0 ){ if( zRight ){ - sqlite3RegisterLikeFunctions(db, sqlite3GetBoolean(zRight, 0)); + sqlite3RegisterLikeFunctions(db, sqlite3GetBoolean(zRight)); } }else #ifndef SQLITE_INTEGRITY_CHECK_ERROR_MAX # define SQLITE_INTEGRITY_CHECK_ERROR_MAX 100 @@ -94982,11 +94404,10 @@ } if( pEList==0 ){ pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db,TK_ALL,0)); } pNew->pEList = pEList; - if( pSrc==0 ) pSrc = sqlite3DbMallocZero(db, sizeof(*pSrc)); pNew->pSrc = pSrc; pNew->pWhere = pWhere; pNew->pGroupBy = pGroupBy; pNew->pHaving = pHaving; pNew->pOrderBy = pOrderBy; @@ -96167,21 +95588,13 @@ int nCol; /* Number of columns in the result set */ Expr *p; /* Expression for a single result column */ char *zName; /* Column name */ int nName; /* Size of name in zName[] */ - if( pEList ){ - nCol = pEList->nExpr; - aCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol); - testcase( aCol==0 ); - }else{ - nCol = 0; - aCol = 0; - } - *pnCol = nCol; - *paCol = aCol; - + *pnCol = nCol = pEList->nExpr; + aCol = *paCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol); + if( aCol==0 ) return SQLITE_NOMEM; for(i=0, pCol=aCol; ia[i].pExpr; assert( p->pRight==0 || ExprHasProperty(p->pRight, EP_IntValue) @@ -96529,16 +95942,12 @@ /* Make sure all SELECTs in the statement have the same number of elements ** in their result sets. */ assert( p->pEList && pPrior->pEList ); if( p->pEList->nExpr!=pPrior->pEList->nExpr ){ - if( p->selFlags & SF_Values ){ - sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms"); - }else{ - sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" - " do not have the same number of result columns", selectOpName(p->op)); - } + sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s" + " do not have the same number of result columns", selectOpName(p->op)); rc = 1; goto multi_select_end; } /* Compound SELECTs that have an ORDER BY clause are handled separately. @@ -97150,11 +96559,11 @@ Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0); if( pNew==0 ) return SQLITE_NOMEM; pNew->flags |= EP_IntValue; pNew->u.iValue = i; pOrderBy = sqlite3ExprListAppend(pParse, pOrderBy, pNew); - if( pOrderBy ) pOrderBy->a[nOrderBy++].iOrderByCol = (u16)i; + pOrderBy->a[nOrderBy++].iOrderByCol = (u16)i; } } } /* Compute the comparison permutation and keyinfo that is used with @@ -97760,12 +97169,11 @@ /***** If we reach this point, flattening is permitted. *****/ /* Authorize the subquery */ pParse->zAuthContext = pSubitem->zName; - TESTONLY(i =) sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0); - testcase( i==SQLITE_DENY ); + sqlite3AuthCheck(pParse, SQLITE_SELECT, 0, 0, 0); pParse->zAuthContext = zSavedAuthContext; /* If the sub-query is a compound SELECT statement, then (by restrictions ** 17 and 18 above) it must be a UNION ALL and the parent query must ** be of the form: @@ -98514,12 +97922,10 @@ ** the current cursor position. */ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ Vdbe *v = pParse->pVdbe; int i; - int regHit = 0; - int addrHitTest = 0; struct AggInfo_func *pF; struct AggInfo_col *pC; pAggInfo->directMode = 1; sqlite3ExprCacheClear(pParse); @@ -98551,12 +97957,11 @@ pColl = sqlite3ExprCollSeq(pParse, pItem->pExpr); } if( !pColl ){ pColl = pParse->db->pDfltColl; } - if( regHit==0 && pAggInfo->nAccumulator ) regHit = ++pParse->nMem; - sqlite3VdbeAddOp4(v, OP_CollSeq, regHit, 0, 0, (char *)pColl, P4_COLLSEQ); + sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ); } sqlite3VdbeAddOp4(v, OP_AggStep, 0, regAgg, pF->iMem, (void*)pF->pFunc, P4_FUNCDEF); sqlite3VdbeChangeP5(v, (u8)nArg); sqlite3ExprCacheAffinityChange(pParse, regAgg, nArg); @@ -98575,22 +97980,16 @@ ** text or blob value. See ticket [883034dcb5]. ** ** Another solution would be to change the OP_SCopy used to copy cached ** values to an OP_Copy. */ - if( regHit ){ - addrHitTest = sqlite3VdbeAddOp1(v, OP_If, regHit); - } sqlite3ExprCacheClear(pParse); for(i=0, pC=pAggInfo->aCol; inAccumulator; i++, pC++){ sqlite3ExprCode(pParse, pC->pExpr, pC->iMem); } pAggInfo->directMode = 0; sqlite3ExprCacheClear(pParse); - if( addrHitTest ){ - sqlite3VdbeJumpHere(v, addrHitTest); - } } /* ** Add a single OP_Explain instruction to the VDBE to explain a simple ** count(*) query ("SELECT count(*) FROM pTab"). @@ -99146,11 +98545,11 @@ if( pCol->iSorterColumn>=j ){ int r1 = j + regBase; int r2; r2 = sqlite3ExprCodeGetColumn(pParse, - pCol->pTab, pCol->iColumn, pCol->iTable, r1, 0); + pCol->pTab, pCol->iColumn, pCol->iTable, r1); if( r1!=r2 ){ sqlite3VdbeAddOp2(v, OP_SCopy, r2, r1); } j++; } @@ -99527,11 +98926,11 @@ sqlite3ExplainPop(pVdbe); } /* End of the structure debug printing code *****************************************************************************/ -#endif /* defined(SQLITE_ENABLE_TREE_EXPLAIN) */ +#endif /* defined(SQLITE_TEST) || defined(SQLITE_DEBUG) */ /************** End of select.c **********************************************/ /************** Begin file table.c *******************************************/ /* ** 2001 September 15 @@ -101707,22 +101106,10 @@ sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey); if( nKey ) db->nextPagesize = 0; } #endif - rc = execSql(db, pzErrMsg, "PRAGMA vacuum_db.synchronous=OFF"); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - - /* Begin a transaction and take an exclusive lock on the main database - ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, - ** to ensure that we do not try to change the page-size on a WAL database. - */ - rc = execSql(db, pzErrMsg, "BEGIN;"); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - rc = sqlite3BtreeBeginTrans(pMain, 2); - if( rc!=SQLITE_OK ) goto end_of_vacuum; - /* Do not attempt to change the page size for a WAL database */ if( sqlite3PagerGetJournalMode(sqlite3BtreePager(pMain)) ==PAGER_JOURNALMODE_WAL ){ db->nextPagesize = 0; } @@ -101732,16 +101119,24 @@ || NEVER(db->mallocFailed) ){ rc = SQLITE_NOMEM; goto end_of_vacuum; } + rc = execSql(db, pzErrMsg, "PRAGMA vacuum_db.synchronous=OFF"); + if( rc!=SQLITE_OK ){ + goto end_of_vacuum; + } #ifndef SQLITE_OMIT_AUTOVACUUM sqlite3BtreeSetAutoVacuum(pTemp, db->nextAutovac>=0 ? db->nextAutovac : sqlite3BtreeGetAutoVacuum(pMain)); #endif + /* Begin a transaction */ + rc = execSql(db, pzErrMsg, "BEGIN EXCLUSIVE;"); + if( rc!=SQLITE_OK ) goto end_of_vacuum; + /* Query the schema of the main database. Create a mirror schema ** in the temporary database. */ rc = execExecSql(db, pzErrMsg, "SELECT 'CREATE TABLE vacuum_db.' || substr(sql,14) " @@ -102158,18 +101553,17 @@ */ SQLITE_PRIVATE void sqlite3VtabBeginParse( Parse *pParse, /* Parsing context */ Token *pName1, /* Name of new table, or database name */ Token *pName2, /* Name of new table or NULL */ - Token *pModuleName, /* Name of the module for the virtual table */ - int ifNotExists /* No error if the table already exists */ + Token *pModuleName /* Name of the module for the virtual table */ ){ int iDb; /* The database the table is being created in */ Table *pTable; /* The new virtual table */ sqlite3 *db; /* Database connection */ - sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, ifNotExists); + sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, 0); pTable = pParse->pNewTable; if( pTable==0 ) return; assert( 0==pTable->pIndex ); db = pParse->db; @@ -102200,11 +101594,11 @@ ** This routine takes the module argument that has been accumulating ** in pParse->zArg[] and appends it to the list of arguments on the ** virtual table currently under construction in pParse->pTable. */ static void addArgumentToVtab(Parse *pParse){ - if( pParse->sArg.z && pParse->pNewTable ){ + if( pParse->sArg.z && ALWAYS(pParse->pNewTable) ){ const char *z = (const char*)pParse->sArg.z; int n = pParse->sArg.n; sqlite3 *db = pParse->db; addModuleArgument(db, pParse->pNewTable, sqlite3DbStrNDup(db, z, n)); } @@ -102327,11 +101721,11 @@ Table *pTab, Module *pMod, int (*xConstruct)(sqlite3*,void*,int,const char*const*,sqlite3_vtab**,char**), char **pzErr ){ - VtabCtx sCtx, *pPriorCtx; + VtabCtx sCtx; VTable *pVTable; int rc; const char *const*azArg = (const char *const*)pTab->azModuleArg; int nArg = pTab->nModuleArg; char *zErr = 0; @@ -102352,14 +101746,13 @@ /* Invoke the virtual table constructor */ assert( &db->pVtabCtx ); assert( xConstruct ); sCtx.pTab = pTab; sCtx.pVTable = pVTable; - pPriorCtx = db->pVtabCtx; db->pVtabCtx = &sCtx; rc = xConstruct(db, pMod->pAux, nArg, azArg, &pVTable->pVtab, &zErr); - db->pVtabCtx = pPriorCtx; + db->pVtabCtx = 0; if( rc==SQLITE_NOMEM ) db->mallocFailed = 1; if( SQLITE_OK!=rc ){ if( zErr==0 ){ *pzErr = sqlite3MPrintf(db, "vtable constructor failed: %s", zModuleName); @@ -103636,14 +103029,11 @@ #ifdef SQLITE_EBCDIC if( *pnoCase ) return 0; #endif pList = pExpr->x.pList; pLeft = pList->a[1].pExpr; - if( pLeft->op!=TK_COLUMN - || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT - || IsVirtual(pLeft->pTab) - ){ + if( pLeft->op!=TK_COLUMN || sqlite3ExprAffinity(pLeft)!=SQLITE_AFF_TEXT ){ /* IMP: R-02065-49465 The left-hand side of the LIKE or GLOB operator must ** be the name of an indexed column with TEXT affinity. */ return 0; } assert( pLeft->iColumn!=(-1) ); /* Because IPK never has AFF_TEXT */ @@ -104512,23 +103902,19 @@ ** ** 2. All of the columns in the index are either part of the pDistinct ** list, or else the WHERE clause contains a term of the form "col=X", ** where X is a constant value. The collation sequences of the ** comparison and select-list expressions must match those of the index. - ** - ** 3. All of those index columns for which the WHERE clause does not - ** contain a "col=X" term are subject to a NOT NULL constraint. */ for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ if( pIdx->onError==OE_None ) continue; for(i=0; inColumn; i++){ int iCol = pIdx->aiColumn[i]; - if( 0==findTerm(pWC, iBase, iCol, ~(Bitmask)0, WO_EQ, pIdx) ){ - int iIdxCol = findIndexCol(pParse, pDistinct, iBase, pIdx, i); - if( iIdxCol<0 || pTab->aCol[pIdx->aiColumn[i]].notNull==0 ){ - break; - } + if( 0==findTerm(pWC, iBase, iCol, ~(Bitmask)0, WO_EQ, pIdx) + && 0>findIndexCol(pParse, pDistinct, iBase, pIdx, i) + ){ + break; } } if( i==pIdx->nColumn ){ /* This index implies that the DISTINCT qualifier is redundant. */ return 1; @@ -104672,29 +104058,18 @@ ** this index can be used for sorting. */ return 1; } if( pIdx->onError!=OE_None && i==pIdx->nColumn && (wsFlags & WHERE_COLUMN_NULL)==0 - && !referencesOtherTables(pOrderBy, pMaskSet, j, base) - ){ - Column *aCol = pIdx->pTable->aCol; - - /* All terms of this index match some prefix of the ORDER BY clause, - ** the index is UNIQUE, and no terms on the tail of the ORDER BY - ** refer to other tables in a join. So, assuming that the index entries - ** visited contain no NULL values, then this index delivers rows in - ** the required order. - ** - ** It is not possible for any of the first nEqCol index fields to be - ** NULL (since the corresponding "=" operator in the WHERE clause would - ** not be true). So if all remaining index columns have NOT NULL - ** constaints attached to them, we can be confident that the visited - ** index entries are free of NULLs. */ - for(i=nEqCol; inColumn; i++){ - if( aCol[pIdx->aiColumn[i]].notNull==0 ) break; - } - return (i==pIdx->nColumn); + && !referencesOtherTables(pOrderBy, pMaskSet, j, base) ){ + /* All terms of this index match some prefix of the ORDER BY clause + ** and the index is UNIQUE and no terms on the tail of the ORDER BY + ** clause reference other tables in a join. If this is all true then + ** the order by clause is superfluous. Not that if the matching + ** condition is IS NULL then the result is not necessarily unique + ** even on a UNIQUE index, so disallow those cases. */ + return 1; } return 0; } /* @@ -106071,13 +105446,11 @@ } /* If there is a DISTINCT qualifier and this index will scan rows in ** order of the DISTINCT expressions, clear bDist and set the appropriate ** flags in wsFlags. */ - if( isDistinctIndex(pParse, pWC, pProbe, iCur, pDistinct, nEq) - && (wsFlags & WHERE_COLUMN_IN)==0 - ){ + if( isDistinctIndex(pParse, pWC, pProbe, iCur, pDistinct, nEq) ){ bDist = 0; wsFlags |= WHERE_ROWID_RANGE|WHERE_COLUMN_RANGE|WHERE_DISTINCT; } /* If currently calculating the cost of using an index (not the IPK @@ -106770,11 +106143,12 @@ */ static Bitmask codeOneLoopStart( WhereInfo *pWInfo, /* Complete information about the WHERE clause */ int iLevel, /* Which level of pWInfo->a[] should be coded */ u16 wctrlFlags, /* One of the WHERE_* flags defined in sqliteInt.h */ - Bitmask notReady /* Which tables are currently available */ + Bitmask notReady, /* Which tables are currently available */ + Expr *pWhere /* Complete WHERE clause */ ){ int j, k; /* Loop counters */ int iCur; /* The VDBE cursor for the table */ int addrNxt; /* Where to jump to continue with the next IN case */ int omitTable; /* True if we use the index only */ @@ -107309,29 +106683,14 @@ /* If the original WHERE clause is z of the form: (x1 OR x2 OR ...) AND y ** Then for every term xN, evaluate as the subexpression: xN AND z ** That way, terms in y that are factored into the disjunction will ** be picked up by the recursive calls to sqlite3WhereBegin() below. - ** - ** Actually, each subexpression is converted to "xN AND w" where w is - ** the "interesting" terms of z - terms that did not originate in the - ** ON or USING clause of a LEFT JOIN, and terms that are usable as - ** indices. */ if( pWC->nTerm>1 ){ - int iTerm; - for(iTerm=0; iTermnTerm; iTerm++){ - Expr *pExpr = pWC->a[iTerm].pExpr; - if( ExprHasProperty(pExpr, EP_FromJoin) ) continue; - if( pWC->a[iTerm].wtFlags & (TERM_VIRTUAL|TERM_ORINFO) ) continue; - if( (pWC->a[iTerm].eOperator & WO_ALL)==0 ) continue; - pExpr = sqlite3ExprDup(pParse->db, pExpr, 0); - pAndExpr = sqlite3ExprAnd(pParse->db, pAndExpr, pExpr); - } - if( pAndExpr ){ - pAndExpr = sqlite3PExpr(pParse, TK_AND, 0, pAndExpr, 0); - } + pAndExpr = sqlite3ExprAlloc(pParse->db, TK_AND, 0, 0); + pAndExpr->pRight = pWhere; } for(ii=0; iinTerm; ii++){ WhereTerm *pOrTerm = &pOrWc->a[ii]; if( pOrTerm->leftCursor==iCur || pOrTerm->eOperator==WO_AND ){ @@ -107351,11 +106710,11 @@ ); if( (wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); int r; r = sqlite3ExprCodeGetColumn(pParse, pTabItem->pTab, -1, iCur, - regRowid, 0); + regRowid); sqlite3VdbeAddOp4Int(v, OP_RowSetTest, regRowset, sqlite3VdbeCurrentAddr(v)+2, r, iSet); } sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody); @@ -107369,14 +106728,11 @@ /* Finish the loop through table entries that match term pOrTerm. */ sqlite3WhereEnd(pSubWInfo); } } } - if( pAndExpr ){ - pAndExpr->pLeft = 0; - sqlite3ExprDelete(pParse->db, pAndExpr); - } + sqlite3DbFree(pParse->db, pAndExpr); sqlite3VdbeChangeP1(v, iRetInit, sqlite3VdbeCurrentAddr(v)); sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrBrk); sqlite3VdbeResolveLabel(v, iLoopBody); if( pWInfo->nLevel>1 ) sqlite3StackFree(pParse->db, pOrTab); @@ -108028,11 +107384,11 @@ */ notReady = ~(Bitmask)0; for(i=0; ia[i]; explainOneScan(pParse, pTabList, pLevel, i, pLevel->iFrom, wctrlFlags); - notReady = codeOneLoopStart(pWInfo, i, wctrlFlags, notReady); + notReady = codeOneLoopStart(pWInfo, i, wctrlFlags, notReady, pWhere); pWInfo->iContinue = pLevel->addrCont; } #ifdef SQLITE_TEST /* For testing and debugging use only */ /* Record in the query plan information about the current table @@ -108264,11 +107620,11 @@ ** An instance of this structure is used to store the LIKE, ** GLOB, NOT LIKE, and NOT GLOB operators. */ struct LikeOp { Token eOperator; /* "like" or "glob" or "regexp" */ - int bNot; /* True if the NOT keyword is present */ + int not; /* True if the NOT keyword is present */ }; /* ** An instance of the following structure describes the event of a ** TRIGGER. "a" is the event type, one of TK_UPDATE, TK_INSERT, @@ -108283,18 +107639,10 @@ /* ** An instance of this structure holds the ATTACH key and the key type. */ struct AttachKey { int type; Token key; }; -/* -** One or more VALUES claues -*/ -struct ValueList { - ExprList *pList; - Select *pSelect; -}; - /* This is a utility routine used to set the ExprSpan.zStart and ** ExprSpan.zEnd values of pOut so that the span covers the complete ** range of text beginning with pStart and going to the end of pEnd. */ @@ -108414,41 +107762,40 @@ ** YYNRULE the number of rules in the grammar ** YYERRORSYMBOL is the code number of the error symbol. If not ** defined, then do no error processing. */ #define YYCODETYPE unsigned char -#define YYNOCODE 251 +#define YYNOCODE 253 #define YYACTIONTYPE unsigned short int #define YYWILDCARD 67 #define sqlite3ParserTOKENTYPE Token typedef union { int yyinit; sqlite3ParserTOKENTYPE yy0; - struct LimitVal yy64; - Expr* yy122; - Select* yy159; - IdList* yy180; - struct {int value; int mask;} yy207; - u8 yy258; - struct LikeOp yy318; - TriggerStep* yy327; - ExprSpan yy342; - SrcList* yy347; - int yy392; - struct TrigEvent yy410; - ExprList* yy442; - struct ValueList yy487; + int yy4; + struct TrigEvent yy90; + ExprSpan yy118; + TriggerStep* yy203; + u8 yy210; + struct {int value; int mask;} yy215; + SrcList* yy259; + struct LimitVal yy292; + Expr* yy314; + ExprList* yy322; + struct LikeOp yy342; + IdList* yy384; + Select* yy387; } YYMINORTYPE; #ifndef YYSTACKDEPTH #define YYSTACKDEPTH 100 #endif #define sqlite3ParserARG_SDECL Parse *pParse; #define sqlite3ParserARG_PDECL ,Parse *pParse #define sqlite3ParserARG_FETCH Parse *pParse = yypParser->pParse #define sqlite3ParserARG_STORE yypParser->pParse = pParse -#define YYNSTATE 627 -#define YYNRULE 327 +#define YYNSTATE 630 +#define YYNRULE 329 #define YYFALLBACK 1 #define YY_NO_ACTION (YYNSTATE+YYNRULE+2) #define YY_ACCEPT_ACTION (YYNSTATE+YYNRULE+1) #define YY_ERROR_ACTION (YYNSTATE+YYNRULE) @@ -108514,478 +107861,477 @@ ** shifting terminals. ** yy_reduce_ofst[] For each state, the offset into yy_action for ** shifting non-terminals after a reduce. ** yy_default[] Default action for each state. */ -#define YY_ACTTAB_COUNT (1564) +#define YY_ACTTAB_COUNT (1557) static const YYACTIONTYPE yy_action[] = { - /* 0 */ 309, 955, 184, 417, 2, 171, 624, 594, 56, 56, - /* 10 */ 56, 56, 49, 54, 54, 54, 54, 53, 53, 52, - /* 20 */ 52, 52, 51, 233, 620, 619, 298, 620, 619, 234, - /* 30 */ 587, 581, 56, 56, 56, 56, 19, 54, 54, 54, - /* 40 */ 54, 53, 53, 52, 52, 52, 51, 233, 605, 57, - /* 50 */ 58, 48, 579, 578, 580, 580, 55, 55, 56, 56, - /* 60 */ 56, 56, 541, 54, 54, 54, 54, 53, 53, 52, - /* 70 */ 52, 52, 51, 233, 309, 594, 325, 196, 195, 194, - /* 80 */ 33, 54, 54, 54, 54, 53, 53, 52, 52, 52, - /* 90 */ 51, 233, 617, 616, 165, 617, 616, 380, 377, 376, - /* 100 */ 407, 532, 576, 576, 587, 581, 303, 422, 375, 59, - /* 110 */ 53, 53, 52, 52, 52, 51, 233, 50, 47, 146, - /* 120 */ 574, 545, 65, 57, 58, 48, 579, 578, 580, 580, - /* 130 */ 55, 55, 56, 56, 56, 56, 213, 54, 54, 54, - /* 140 */ 54, 53, 53, 52, 52, 52, 51, 233, 309, 223, - /* 150 */ 539, 420, 170, 176, 138, 280, 383, 275, 382, 168, - /* 160 */ 489, 551, 409, 668, 620, 619, 271, 438, 409, 438, - /* 170 */ 550, 604, 67, 482, 507, 618, 599, 412, 587, 581, - /* 180 */ 600, 483, 618, 412, 618, 598, 91, 439, 440, 439, - /* 190 */ 335, 598, 73, 669, 222, 266, 480, 57, 58, 48, - /* 200 */ 579, 578, 580, 580, 55, 55, 56, 56, 56, 56, - /* 210 */ 670, 54, 54, 54, 54, 53, 53, 52, 52, 52, - /* 220 */ 51, 233, 309, 279, 232, 231, 1, 132, 200, 385, - /* 230 */ 620, 619, 617, 616, 278, 435, 289, 563, 175, 262, - /* 240 */ 409, 264, 437, 497, 436, 166, 441, 568, 336, 568, - /* 250 */ 201, 537, 587, 581, 599, 412, 165, 594, 600, 380, - /* 260 */ 377, 376, 597, 598, 92, 523, 618, 569, 569, 592, - /* 270 */ 375, 57, 58, 48, 579, 578, 580, 580, 55, 55, - /* 280 */ 56, 56, 56, 56, 597, 54, 54, 54, 54, 53, - /* 290 */ 53, 52, 52, 52, 51, 233, 309, 463, 617, 616, - /* 300 */ 590, 590, 590, 174, 272, 396, 409, 272, 409, 548, - /* 310 */ 397, 620, 619, 68, 326, 620, 619, 620, 619, 618, - /* 320 */ 546, 412, 618, 412, 471, 594, 587, 581, 472, 598, - /* 330 */ 92, 598, 92, 52, 52, 52, 51, 233, 513, 512, - /* 340 */ 206, 322, 363, 464, 221, 57, 58, 48, 579, 578, - /* 350 */ 580, 580, 55, 55, 56, 56, 56, 56, 529, 54, - /* 360 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 233, - /* 370 */ 309, 396, 409, 396, 597, 372, 386, 530, 347, 617, - /* 380 */ 616, 575, 202, 617, 616, 617, 616, 412, 620, 619, - /* 390 */ 145, 255, 346, 254, 577, 598, 74, 351, 45, 489, - /* 400 */ 587, 581, 235, 189, 464, 544, 167, 296, 187, 469, - /* 410 */ 479, 67, 62, 39, 618, 546, 597, 345, 573, 57, - /* 420 */ 58, 48, 579, 578, 580, 580, 55, 55, 56, 56, - /* 430 */ 56, 56, 6, 54, 54, 54, 54, 53, 53, 52, - /* 440 */ 52, 52, 51, 233, 309, 562, 558, 407, 528, 576, - /* 450 */ 576, 344, 255, 346, 254, 182, 617, 616, 503, 504, - /* 460 */ 314, 409, 557, 235, 166, 271, 409, 352, 564, 181, - /* 470 */ 407, 546, 576, 576, 587, 581, 412, 537, 556, 561, - /* 480 */ 517, 412, 618, 249, 598, 16, 7, 36, 467, 598, - /* 490 */ 92, 516, 618, 57, 58, 48, 579, 578, 580, 580, - /* 500 */ 55, 55, 56, 56, 56, 56, 541, 54, 54, 54, - /* 510 */ 54, 53, 53, 52, 52, 52, 51, 233, 309, 327, - /* 520 */ 572, 571, 525, 558, 560, 394, 871, 246, 409, 248, - /* 530 */ 171, 392, 594, 219, 407, 409, 576, 576, 502, 557, - /* 540 */ 364, 145, 510, 412, 407, 229, 576, 576, 587, 581, - /* 550 */ 412, 598, 92, 381, 269, 556, 166, 400, 598, 69, - /* 560 */ 501, 419, 945, 199, 945, 198, 546, 57, 58, 48, - /* 570 */ 579, 578, 580, 580, 55, 55, 56, 56, 56, 56, - /* 580 */ 568, 54, 54, 54, 54, 53, 53, 52, 52, 52, - /* 590 */ 51, 233, 309, 317, 419, 944, 508, 944, 308, 597, - /* 600 */ 594, 565, 490, 212, 173, 247, 423, 615, 614, 613, - /* 610 */ 323, 197, 143, 405, 572, 571, 489, 66, 50, 47, - /* 620 */ 146, 594, 587, 581, 232, 231, 559, 427, 67, 555, - /* 630 */ 15, 618, 186, 543, 303, 421, 35, 206, 432, 423, - /* 640 */ 552, 57, 58, 48, 579, 578, 580, 580, 55, 55, - /* 650 */ 56, 56, 56, 56, 205, 54, 54, 54, 54, 53, - /* 660 */ 53, 52, 52, 52, 51, 233, 309, 569, 569, 260, - /* 670 */ 268, 597, 12, 373, 568, 166, 409, 313, 409, 420, - /* 680 */ 409, 473, 473, 365, 618, 50, 47, 146, 597, 594, - /* 690 */ 468, 412, 166, 412, 351, 412, 587, 581, 32, 598, - /* 700 */ 94, 598, 97, 598, 95, 627, 625, 329, 142, 50, - /* 710 */ 47, 146, 333, 349, 358, 57, 58, 48, 579, 578, - /* 720 */ 580, 580, 55, 55, 56, 56, 56, 56, 409, 54, - /* 730 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 233, - /* 740 */ 309, 409, 388, 412, 409, 22, 565, 404, 212, 362, - /* 750 */ 389, 598, 104, 359, 409, 156, 412, 409, 603, 412, - /* 760 */ 537, 331, 569, 569, 598, 103, 493, 598, 105, 412, - /* 770 */ 587, 581, 412, 260, 549, 618, 11, 598, 106, 521, - /* 780 */ 598, 133, 169, 457, 456, 170, 35, 601, 618, 57, - /* 790 */ 58, 48, 579, 578, 580, 580, 55, 55, 56, 56, - /* 800 */ 56, 56, 409, 54, 54, 54, 54, 53, 53, 52, - /* 810 */ 52, 52, 51, 233, 309, 409, 259, 412, 409, 50, - /* 820 */ 47, 146, 357, 318, 355, 598, 134, 527, 352, 337, - /* 830 */ 412, 409, 356, 412, 357, 409, 357, 618, 598, 98, - /* 840 */ 129, 598, 102, 618, 587, 581, 412, 21, 235, 618, - /* 850 */ 412, 618, 211, 143, 598, 101, 30, 167, 598, 93, - /* 860 */ 350, 535, 203, 57, 58, 48, 579, 578, 580, 580, - /* 870 */ 55, 55, 56, 56, 56, 56, 409, 54, 54, 54, - /* 880 */ 54, 53, 53, 52, 52, 52, 51, 233, 309, 409, - /* 890 */ 526, 412, 409, 425, 215, 305, 597, 551, 141, 598, - /* 900 */ 100, 40, 409, 38, 412, 409, 550, 412, 409, 228, - /* 910 */ 220, 314, 598, 77, 500, 598, 96, 412, 587, 581, - /* 920 */ 412, 338, 253, 412, 218, 598, 137, 379, 598, 136, - /* 930 */ 28, 598, 135, 270, 715, 210, 481, 57, 58, 48, - /* 940 */ 579, 578, 580, 580, 55, 55, 56, 56, 56, 56, - /* 950 */ 409, 54, 54, 54, 54, 53, 53, 52, 52, 52, - /* 960 */ 51, 233, 309, 409, 272, 412, 409, 315, 147, 597, - /* 970 */ 272, 626, 2, 598, 76, 209, 409, 127, 412, 618, - /* 980 */ 126, 412, 409, 621, 235, 618, 598, 90, 374, 598, - /* 990 */ 89, 412, 587, 581, 27, 260, 350, 412, 618, 598, - /* 1000 */ 75, 321, 541, 541, 125, 598, 88, 320, 278, 597, - /* 1010 */ 618, 57, 46, 48, 579, 578, 580, 580, 55, 55, - /* 1020 */ 56, 56, 56, 56, 409, 54, 54, 54, 54, 53, - /* 1030 */ 53, 52, 52, 52, 51, 233, 309, 409, 450, 412, - /* 1040 */ 164, 284, 282, 272, 609, 424, 304, 598, 87, 370, - /* 1050 */ 409, 477, 412, 409, 608, 409, 607, 602, 618, 618, - /* 1060 */ 598, 99, 586, 585, 122, 412, 587, 581, 412, 618, - /* 1070 */ 412, 618, 618, 598, 86, 366, 598, 17, 598, 85, - /* 1080 */ 319, 185, 519, 518, 583, 582, 58, 48, 579, 578, - /* 1090 */ 580, 580, 55, 55, 56, 56, 56, 56, 409, 54, - /* 1100 */ 54, 54, 54, 53, 53, 52, 52, 52, 51, 233, - /* 1110 */ 309, 584, 409, 412, 409, 260, 260, 260, 408, 591, - /* 1120 */ 474, 598, 84, 170, 409, 466, 518, 412, 121, 412, - /* 1130 */ 618, 618, 618, 618, 618, 598, 83, 598, 72, 412, - /* 1140 */ 587, 581, 51, 233, 625, 329, 470, 598, 71, 257, - /* 1150 */ 159, 120, 14, 462, 157, 158, 117, 260, 448, 447, - /* 1160 */ 446, 48, 579, 578, 580, 580, 55, 55, 56, 56, - /* 1170 */ 56, 56, 618, 54, 54, 54, 54, 53, 53, 52, - /* 1180 */ 52, 52, 51, 233, 44, 403, 260, 3, 409, 459, - /* 1190 */ 260, 413, 619, 118, 398, 10, 25, 24, 554, 348, - /* 1200 */ 217, 618, 406, 412, 409, 618, 4, 44, 403, 618, - /* 1210 */ 3, 598, 82, 618, 413, 619, 455, 542, 115, 412, - /* 1220 */ 538, 401, 536, 274, 506, 406, 251, 598, 81, 216, - /* 1230 */ 273, 563, 618, 243, 453, 618, 154, 618, 618, 618, - /* 1240 */ 449, 416, 623, 110, 401, 618, 409, 236, 64, 123, - /* 1250 */ 487, 41, 42, 531, 563, 204, 409, 267, 43, 411, - /* 1260 */ 410, 412, 265, 592, 108, 618, 107, 434, 332, 598, - /* 1270 */ 80, 412, 618, 263, 41, 42, 443, 618, 409, 598, - /* 1280 */ 70, 43, 411, 410, 433, 261, 592, 149, 618, 597, - /* 1290 */ 256, 237, 188, 412, 590, 590, 590, 589, 588, 13, - /* 1300 */ 618, 598, 18, 328, 235, 618, 44, 403, 360, 3, - /* 1310 */ 418, 461, 339, 413, 619, 227, 124, 590, 590, 590, - /* 1320 */ 589, 588, 13, 618, 406, 409, 618, 409, 139, 34, - /* 1330 */ 403, 387, 3, 148, 622, 312, 413, 619, 311, 330, - /* 1340 */ 412, 460, 412, 401, 180, 353, 412, 406, 598, 79, - /* 1350 */ 598, 78, 250, 563, 598, 9, 618, 612, 611, 610, - /* 1360 */ 618, 8, 452, 442, 242, 415, 401, 618, 239, 235, - /* 1370 */ 179, 238, 428, 41, 42, 288, 563, 618, 618, 618, - /* 1380 */ 43, 411, 410, 618, 144, 592, 618, 618, 177, 61, - /* 1390 */ 618, 596, 391, 620, 619, 287, 41, 42, 414, 618, - /* 1400 */ 293, 30, 393, 43, 411, 410, 292, 618, 592, 31, - /* 1410 */ 618, 395, 291, 60, 230, 37, 590, 590, 590, 589, - /* 1420 */ 588, 13, 214, 553, 183, 290, 172, 301, 300, 299, - /* 1430 */ 178, 297, 595, 563, 451, 29, 285, 390, 540, 590, - /* 1440 */ 590, 590, 589, 588, 13, 283, 520, 534, 150, 533, - /* 1450 */ 241, 281, 384, 192, 191, 324, 515, 514, 276, 240, - /* 1460 */ 510, 523, 307, 511, 128, 592, 509, 225, 226, 486, - /* 1470 */ 485, 224, 152, 491, 464, 306, 484, 163, 153, 371, - /* 1480 */ 478, 151, 162, 258, 369, 161, 367, 208, 475, 476, - /* 1490 */ 26, 160, 465, 140, 361, 131, 590, 590, 590, 116, - /* 1500 */ 119, 454, 343, 155, 114, 342, 113, 112, 445, 111, - /* 1510 */ 130, 109, 431, 316, 426, 430, 23, 429, 20, 606, - /* 1520 */ 190, 507, 255, 341, 244, 63, 294, 593, 310, 570, - /* 1530 */ 277, 402, 354, 235, 567, 496, 495, 492, 494, 302, - /* 1540 */ 458, 378, 286, 245, 566, 5, 252, 547, 193, 444, - /* 1550 */ 233, 340, 207, 524, 368, 505, 334, 522, 499, 399, - /* 1560 */ 295, 498, 956, 488, + /* 0 */ 313, 960, 186, 419, 2, 172, 627, 597, 55, 55, + /* 10 */ 55, 55, 48, 53, 53, 53, 53, 52, 52, 51, + /* 20 */ 51, 51, 50, 238, 302, 283, 623, 622, 516, 515, + /* 30 */ 590, 584, 55, 55, 55, 55, 282, 53, 53, 53, + /* 40 */ 53, 52, 52, 51, 51, 51, 50, 238, 6, 56, + /* 50 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, + /* 60 */ 55, 55, 608, 53, 53, 53, 53, 52, 52, 51, + /* 70 */ 51, 51, 50, 238, 313, 597, 409, 330, 579, 579, + /* 80 */ 32, 53, 53, 53, 53, 52, 52, 51, 51, 51, + /* 90 */ 50, 238, 330, 217, 620, 619, 166, 411, 624, 382, + /* 100 */ 379, 378, 7, 491, 590, 584, 200, 199, 198, 58, + /* 110 */ 377, 300, 414, 621, 481, 66, 623, 622, 621, 580, + /* 120 */ 254, 601, 94, 56, 57, 47, 582, 581, 583, 583, + /* 130 */ 54, 54, 55, 55, 55, 55, 671, 53, 53, 53, + /* 140 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 532, + /* 150 */ 226, 506, 507, 133, 177, 139, 284, 385, 279, 384, + /* 160 */ 169, 197, 342, 398, 251, 226, 253, 275, 388, 167, + /* 170 */ 139, 284, 385, 279, 384, 169, 570, 236, 590, 584, + /* 180 */ 672, 240, 275, 157, 620, 619, 554, 437, 51, 51, + /* 190 */ 51, 50, 238, 343, 439, 553, 438, 56, 57, 47, + /* 200 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, + /* 210 */ 465, 53, 53, 53, 53, 52, 52, 51, 51, 51, + /* 220 */ 50, 238, 313, 390, 52, 52, 51, 51, 51, 50, + /* 230 */ 238, 391, 166, 491, 566, 382, 379, 378, 409, 440, + /* 240 */ 579, 579, 252, 440, 607, 66, 377, 513, 621, 49, + /* 250 */ 46, 147, 590, 584, 621, 16, 466, 189, 621, 441, + /* 260 */ 442, 673, 526, 441, 340, 577, 595, 64, 194, 482, + /* 270 */ 434, 56, 57, 47, 582, 581, 583, 583, 54, 54, + /* 280 */ 55, 55, 55, 55, 30, 53, 53, 53, 53, 52, + /* 290 */ 52, 51, 51, 51, 50, 238, 313, 593, 593, 593, + /* 300 */ 387, 578, 606, 493, 259, 351, 258, 411, 1, 623, + /* 310 */ 622, 496, 623, 622, 65, 240, 623, 622, 597, 443, + /* 320 */ 237, 239, 414, 341, 237, 602, 590, 584, 18, 603, + /* 330 */ 166, 601, 87, 382, 379, 378, 67, 623, 622, 38, + /* 340 */ 623, 622, 176, 270, 377, 56, 57, 47, 582, 581, + /* 350 */ 583, 583, 54, 54, 55, 55, 55, 55, 175, 53, + /* 360 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, + /* 370 */ 313, 396, 233, 411, 531, 565, 317, 620, 619, 44, + /* 380 */ 620, 619, 240, 206, 620, 619, 597, 266, 414, 268, + /* 390 */ 409, 597, 579, 579, 352, 184, 505, 601, 73, 533, + /* 400 */ 590, 584, 466, 548, 190, 620, 619, 576, 620, 619, + /* 410 */ 547, 383, 551, 35, 332, 575, 574, 600, 504, 56, + /* 420 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, + /* 430 */ 55, 55, 567, 53, 53, 53, 53, 52, 52, 51, + /* 440 */ 51, 51, 50, 238, 313, 411, 561, 561, 528, 364, + /* 450 */ 259, 351, 258, 183, 361, 549, 524, 374, 411, 597, + /* 460 */ 414, 240, 560, 560, 409, 604, 579, 579, 328, 601, + /* 470 */ 93, 623, 622, 414, 590, 584, 237, 564, 559, 559, + /* 480 */ 520, 402, 601, 87, 409, 210, 579, 579, 168, 421, + /* 490 */ 950, 519, 950, 56, 57, 47, 582, 581, 583, 583, + /* 500 */ 54, 54, 55, 55, 55, 55, 192, 53, 53, 53, + /* 510 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 600, + /* 520 */ 293, 563, 511, 234, 357, 146, 475, 475, 367, 411, + /* 530 */ 562, 411, 358, 542, 425, 171, 411, 215, 144, 620, + /* 540 */ 619, 544, 318, 353, 414, 203, 414, 275, 590, 584, + /* 550 */ 549, 414, 174, 601, 94, 601, 79, 558, 471, 61, + /* 560 */ 601, 79, 421, 949, 350, 949, 34, 56, 57, 47, + /* 570 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, + /* 580 */ 535, 53, 53, 53, 53, 52, 52, 51, 51, 51, + /* 590 */ 50, 238, 313, 307, 424, 394, 272, 49, 46, 147, + /* 600 */ 349, 322, 4, 411, 491, 312, 321, 425, 568, 492, + /* 610 */ 216, 264, 407, 575, 574, 429, 66, 549, 414, 621, + /* 620 */ 540, 602, 590, 584, 13, 603, 621, 601, 72, 12, + /* 630 */ 618, 617, 616, 202, 210, 621, 546, 469, 422, 319, + /* 640 */ 148, 56, 57, 47, 582, 581, 583, 583, 54, 54, + /* 650 */ 55, 55, 55, 55, 338, 53, 53, 53, 53, 52, + /* 660 */ 52, 51, 51, 51, 50, 238, 313, 600, 600, 411, + /* 670 */ 39, 21, 37, 170, 237, 875, 411, 572, 572, 201, + /* 680 */ 144, 473, 538, 331, 414, 474, 143, 146, 630, 628, + /* 690 */ 334, 414, 353, 601, 68, 168, 590, 584, 132, 365, + /* 700 */ 601, 96, 307, 423, 530, 336, 49, 46, 147, 568, + /* 710 */ 406, 216, 549, 360, 529, 56, 57, 47, 582, 581, + /* 720 */ 583, 583, 54, 54, 55, 55, 55, 55, 411, 53, + /* 730 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, + /* 740 */ 313, 411, 605, 414, 484, 510, 172, 422, 597, 318, + /* 750 */ 496, 485, 601, 99, 411, 142, 414, 411, 231, 411, + /* 760 */ 540, 411, 359, 629, 2, 601, 97, 426, 308, 414, + /* 770 */ 590, 584, 414, 20, 414, 621, 414, 621, 601, 106, + /* 780 */ 503, 601, 105, 601, 108, 601, 109, 204, 28, 56, + /* 790 */ 57, 47, 582, 581, 583, 583, 54, 54, 55, 55, + /* 800 */ 55, 55, 411, 53, 53, 53, 53, 52, 52, 51, + /* 810 */ 51, 51, 50, 238, 313, 411, 597, 414, 411, 276, + /* 820 */ 214, 600, 411, 366, 213, 381, 601, 134, 274, 500, + /* 830 */ 414, 167, 130, 414, 621, 411, 354, 414, 376, 601, + /* 840 */ 135, 129, 601, 100, 590, 584, 601, 104, 522, 521, + /* 850 */ 414, 621, 224, 273, 600, 167, 327, 282, 600, 601, + /* 860 */ 103, 468, 521, 56, 57, 47, 582, 581, 583, 583, + /* 870 */ 54, 54, 55, 55, 55, 55, 411, 53, 53, 53, + /* 880 */ 53, 52, 52, 51, 51, 51, 50, 238, 313, 411, + /* 890 */ 27, 414, 411, 375, 276, 167, 359, 544, 50, 238, + /* 900 */ 601, 95, 128, 223, 414, 411, 165, 414, 411, 621, + /* 910 */ 411, 621, 612, 601, 102, 372, 601, 76, 590, 584, + /* 920 */ 414, 570, 236, 414, 470, 414, 167, 621, 188, 601, + /* 930 */ 98, 225, 601, 138, 601, 137, 232, 56, 45, 47, + /* 940 */ 582, 581, 583, 583, 54, 54, 55, 55, 55, 55, + /* 950 */ 411, 53, 53, 53, 53, 52, 52, 51, 51, 51, + /* 960 */ 50, 238, 313, 276, 276, 414, 411, 276, 544, 459, + /* 970 */ 359, 171, 209, 479, 601, 136, 628, 334, 621, 621, + /* 980 */ 125, 414, 621, 368, 411, 621, 257, 540, 589, 588, + /* 990 */ 601, 75, 590, 584, 458, 446, 23, 23, 124, 414, + /* 1000 */ 326, 325, 621, 427, 324, 309, 600, 288, 601, 92, + /* 1010 */ 586, 585, 57, 47, 582, 581, 583, 583, 54, 54, + /* 1020 */ 55, 55, 55, 55, 411, 53, 53, 53, 53, 52, + /* 1030 */ 52, 51, 51, 51, 50, 238, 313, 587, 411, 414, + /* 1040 */ 411, 207, 611, 476, 171, 472, 160, 123, 601, 91, + /* 1050 */ 323, 261, 15, 414, 464, 414, 411, 621, 411, 354, + /* 1060 */ 222, 411, 601, 74, 601, 90, 590, 584, 159, 264, + /* 1070 */ 158, 414, 461, 414, 621, 600, 414, 121, 120, 25, + /* 1080 */ 601, 89, 601, 101, 621, 601, 88, 47, 582, 581, + /* 1090 */ 583, 583, 54, 54, 55, 55, 55, 55, 544, 53, + /* 1100 */ 53, 53, 53, 52, 52, 51, 51, 51, 50, 238, + /* 1110 */ 43, 405, 263, 3, 610, 264, 140, 415, 622, 24, + /* 1120 */ 410, 11, 456, 594, 118, 155, 219, 452, 408, 621, + /* 1130 */ 621, 621, 156, 43, 405, 621, 3, 286, 621, 113, + /* 1140 */ 415, 622, 111, 445, 411, 400, 557, 403, 545, 10, + /* 1150 */ 411, 408, 264, 110, 205, 436, 541, 566, 453, 414, + /* 1160 */ 621, 621, 63, 621, 435, 414, 411, 621, 601, 94, + /* 1170 */ 403, 621, 411, 337, 601, 86, 150, 40, 41, 534, + /* 1180 */ 566, 414, 242, 264, 42, 413, 412, 414, 600, 595, + /* 1190 */ 601, 85, 191, 333, 107, 451, 601, 84, 621, 539, + /* 1200 */ 40, 41, 420, 230, 411, 149, 316, 42, 413, 412, + /* 1210 */ 398, 127, 595, 315, 621, 399, 278, 625, 181, 414, + /* 1220 */ 593, 593, 593, 592, 591, 14, 450, 411, 601, 71, + /* 1230 */ 240, 621, 43, 405, 264, 3, 615, 180, 264, 415, + /* 1240 */ 622, 614, 414, 593, 593, 593, 592, 591, 14, 621, + /* 1250 */ 408, 601, 70, 621, 417, 33, 405, 613, 3, 411, + /* 1260 */ 264, 411, 415, 622, 418, 626, 178, 509, 8, 403, + /* 1270 */ 241, 416, 126, 408, 414, 621, 414, 449, 208, 566, + /* 1280 */ 240, 221, 621, 601, 83, 601, 82, 599, 297, 277, + /* 1290 */ 296, 30, 403, 31, 395, 264, 295, 397, 489, 40, + /* 1300 */ 41, 411, 566, 220, 621, 294, 42, 413, 412, 271, + /* 1310 */ 621, 595, 600, 621, 59, 60, 414, 269, 267, 623, + /* 1320 */ 622, 36, 40, 41, 621, 601, 81, 598, 235, 42, + /* 1330 */ 413, 412, 621, 621, 595, 265, 344, 411, 248, 556, + /* 1340 */ 173, 185, 593, 593, 593, 592, 591, 14, 218, 29, + /* 1350 */ 621, 543, 414, 305, 304, 303, 179, 301, 411, 566, + /* 1360 */ 454, 601, 80, 289, 335, 593, 593, 593, 592, 591, + /* 1370 */ 14, 411, 287, 414, 151, 392, 246, 260, 411, 196, + /* 1380 */ 195, 523, 601, 69, 411, 245, 414, 526, 537, 285, + /* 1390 */ 389, 595, 621, 414, 536, 601, 17, 362, 153, 414, + /* 1400 */ 466, 463, 601, 78, 154, 414, 462, 152, 601, 77, + /* 1410 */ 355, 255, 621, 455, 601, 9, 621, 386, 444, 517, + /* 1420 */ 247, 621, 593, 593, 593, 621, 621, 244, 621, 243, + /* 1430 */ 430, 518, 292, 621, 329, 621, 145, 393, 280, 513, + /* 1440 */ 291, 131, 621, 514, 621, 621, 311, 621, 259, 346, + /* 1450 */ 249, 621, 621, 229, 314, 621, 228, 512, 227, 240, + /* 1460 */ 494, 488, 310, 164, 487, 486, 373, 480, 163, 262, + /* 1470 */ 369, 371, 162, 26, 212, 478, 477, 161, 141, 363, + /* 1480 */ 467, 122, 339, 187, 119, 348, 347, 117, 116, 115, + /* 1490 */ 114, 112, 182, 457, 320, 22, 433, 432, 448, 19, + /* 1500 */ 609, 431, 428, 62, 193, 596, 573, 298, 555, 552, + /* 1510 */ 571, 404, 290, 380, 498, 510, 495, 306, 281, 499, + /* 1520 */ 250, 5, 497, 460, 345, 447, 569, 550, 238, 299, + /* 1530 */ 527, 525, 508, 961, 502, 501, 961, 401, 961, 211, + /* 1540 */ 490, 356, 256, 961, 483, 961, 961, 961, 961, 961, + /* 1550 */ 961, 961, 961, 961, 961, 961, 370, }; static const YYCODETYPE yy_lookahead[] = { /* 0 */ 19, 142, 143, 144, 145, 24, 1, 26, 77, 78, /* 10 */ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - /* 20 */ 89, 90, 91, 92, 26, 27, 15, 26, 27, 197, - /* 30 */ 49, 50, 77, 78, 79, 80, 204, 82, 83, 84, - /* 40 */ 85, 86, 87, 88, 89, 90, 91, 92, 23, 68, + /* 20 */ 89, 90, 91, 92, 15, 98, 26, 27, 7, 8, + /* 30 */ 49, 50, 77, 78, 79, 80, 109, 82, 83, 84, + /* 40 */ 85, 86, 87, 88, 89, 90, 91, 92, 22, 68, /* 50 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - /* 60 */ 79, 80, 166, 82, 83, 84, 85, 86, 87, 88, - /* 70 */ 89, 90, 91, 92, 19, 94, 19, 105, 106, 107, + /* 60 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, + /* 70 */ 89, 90, 91, 92, 19, 94, 112, 19, 114, 115, /* 80 */ 25, 82, 83, 84, 85, 86, 87, 88, 89, 90, - /* 90 */ 91, 92, 94, 95, 96, 94, 95, 99, 100, 101, - /* 100 */ 112, 205, 114, 115, 49, 50, 22, 23, 110, 54, - /* 110 */ 86, 87, 88, 89, 90, 91, 92, 221, 222, 223, - /* 120 */ 23, 120, 25, 68, 69, 70, 71, 72, 73, 74, - /* 130 */ 75, 76, 77, 78, 79, 80, 22, 82, 83, 84, - /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 92, - /* 150 */ 23, 67, 25, 96, 97, 98, 99, 100, 101, 102, - /* 160 */ 150, 32, 150, 118, 26, 27, 109, 150, 150, 150, - /* 170 */ 41, 161, 162, 180, 181, 165, 113, 165, 49, 50, - /* 180 */ 117, 188, 165, 165, 165, 173, 174, 170, 171, 170, - /* 190 */ 171, 173, 174, 118, 184, 16, 186, 68, 69, 70, + /* 90 */ 91, 92, 19, 22, 94, 95, 96, 150, 150, 99, + /* 100 */ 100, 101, 76, 150, 49, 50, 105, 106, 107, 54, + /* 110 */ 110, 158, 165, 165, 161, 162, 26, 27, 165, 113, + /* 120 */ 16, 174, 175, 68, 69, 70, 71, 72, 73, 74, + /* 130 */ 75, 76, 77, 78, 79, 80, 118, 82, 83, 84, + /* 140 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 23, + /* 150 */ 92, 97, 98, 24, 96, 97, 98, 99, 100, 101, + /* 160 */ 102, 25, 97, 216, 60, 92, 62, 109, 221, 25, + /* 170 */ 97, 98, 99, 100, 101, 102, 86, 87, 49, 50, + /* 180 */ 118, 116, 109, 25, 94, 95, 32, 97, 88, 89, + /* 190 */ 90, 91, 92, 128, 104, 41, 106, 68, 69, 70, /* 200 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - /* 210 */ 118, 82, 83, 84, 85, 86, 87, 88, 89, 90, - /* 220 */ 91, 92, 19, 98, 86, 87, 22, 24, 160, 88, - /* 230 */ 26, 27, 94, 95, 109, 97, 224, 66, 118, 60, - /* 240 */ 150, 62, 104, 23, 106, 25, 229, 230, 229, 230, - /* 250 */ 160, 150, 49, 50, 113, 165, 96, 26, 117, 99, - /* 260 */ 100, 101, 194, 173, 174, 94, 165, 129, 130, 98, - /* 270 */ 110, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 280 */ 77, 78, 79, 80, 194, 82, 83, 84, 85, 86, - /* 290 */ 87, 88, 89, 90, 91, 92, 19, 11, 94, 95, - /* 300 */ 129, 130, 131, 118, 150, 215, 150, 150, 150, 25, - /* 310 */ 220, 26, 27, 22, 213, 26, 27, 26, 27, 165, - /* 320 */ 25, 165, 165, 165, 30, 94, 49, 50, 34, 173, - /* 330 */ 174, 173, 174, 88, 89, 90, 91, 92, 7, 8, - /* 340 */ 160, 187, 48, 57, 187, 68, 69, 70, 71, 72, - /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 23, 82, + /* 210 */ 11, 82, 83, 84, 85, 86, 87, 88, 89, 90, + /* 220 */ 91, 92, 19, 19, 86, 87, 88, 89, 90, 91, + /* 230 */ 92, 27, 96, 150, 66, 99, 100, 101, 112, 150, + /* 240 */ 114, 115, 138, 150, 161, 162, 110, 103, 165, 222, + /* 250 */ 223, 224, 49, 50, 165, 22, 57, 24, 165, 170, + /* 260 */ 171, 118, 94, 170, 171, 23, 98, 25, 185, 186, + /* 270 */ 243, 68, 69, 70, 71, 72, 73, 74, 75, 76, + /* 280 */ 77, 78, 79, 80, 126, 82, 83, 84, 85, 86, + /* 290 */ 87, 88, 89, 90, 91, 92, 19, 129, 130, 131, + /* 300 */ 88, 23, 172, 173, 105, 106, 107, 150, 22, 26, + /* 310 */ 27, 181, 26, 27, 22, 116, 26, 27, 26, 230, + /* 320 */ 231, 197, 165, 230, 231, 113, 49, 50, 204, 117, + /* 330 */ 96, 174, 175, 99, 100, 101, 22, 26, 27, 136, + /* 340 */ 26, 27, 118, 16, 110, 68, 69, 70, 71, 72, + /* 350 */ 73, 74, 75, 76, 77, 78, 79, 80, 118, 82, /* 360 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - /* 370 */ 19, 215, 150, 215, 194, 19, 220, 88, 220, 94, - /* 380 */ 95, 23, 160, 94, 95, 94, 95, 165, 26, 27, - /* 390 */ 95, 105, 106, 107, 113, 173, 174, 217, 22, 150, - /* 400 */ 49, 50, 116, 119, 57, 120, 50, 158, 22, 21, - /* 410 */ 161, 162, 232, 136, 165, 120, 194, 237, 23, 68, + /* 370 */ 19, 214, 215, 150, 23, 23, 155, 94, 95, 22, + /* 380 */ 94, 95, 116, 160, 94, 95, 94, 60, 165, 62, + /* 390 */ 112, 26, 114, 115, 128, 23, 36, 174, 175, 88, + /* 400 */ 49, 50, 57, 120, 22, 94, 95, 23, 94, 95, + /* 410 */ 120, 51, 25, 136, 169, 170, 171, 194, 58, 68, /* 420 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - /* 430 */ 79, 80, 22, 82, 83, 84, 85, 86, 87, 88, - /* 440 */ 89, 90, 91, 92, 19, 23, 12, 112, 23, 114, - /* 450 */ 115, 63, 105, 106, 107, 23, 94, 95, 97, 98, - /* 460 */ 104, 150, 28, 116, 25, 109, 150, 150, 23, 23, - /* 470 */ 112, 25, 114, 115, 49, 50, 165, 150, 44, 11, - /* 480 */ 46, 165, 165, 16, 173, 174, 76, 136, 100, 173, - /* 490 */ 174, 57, 165, 68, 69, 70, 71, 72, 73, 74, - /* 500 */ 75, 76, 77, 78, 79, 80, 166, 82, 83, 84, - /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 169, - /* 520 */ 170, 171, 23, 12, 23, 214, 138, 60, 150, 62, - /* 530 */ 24, 215, 26, 216, 112, 150, 114, 115, 36, 28, - /* 540 */ 213, 95, 103, 165, 112, 205, 114, 115, 49, 50, - /* 550 */ 165, 173, 174, 51, 23, 44, 25, 46, 173, 174, - /* 560 */ 58, 22, 23, 22, 25, 160, 120, 68, 69, 70, + /* 430 */ 79, 80, 23, 82, 83, 84, 85, 86, 87, 88, + /* 440 */ 89, 90, 91, 92, 19, 150, 12, 12, 23, 228, + /* 450 */ 105, 106, 107, 23, 233, 25, 165, 19, 150, 94, + /* 460 */ 165, 116, 28, 28, 112, 174, 114, 115, 108, 174, + /* 470 */ 175, 26, 27, 165, 49, 50, 231, 11, 44, 44, + /* 480 */ 46, 46, 174, 175, 112, 160, 114, 115, 50, 22, + /* 490 */ 23, 57, 25, 68, 69, 70, 71, 72, 73, 74, + /* 500 */ 75, 76, 77, 78, 79, 80, 119, 82, 83, 84, + /* 510 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 194, + /* 520 */ 225, 23, 23, 215, 19, 95, 105, 106, 107, 150, + /* 530 */ 23, 150, 27, 23, 67, 25, 150, 206, 207, 94, + /* 540 */ 95, 166, 104, 218, 165, 22, 165, 109, 49, 50, + /* 550 */ 120, 165, 25, 174, 175, 174, 175, 23, 21, 234, + /* 560 */ 174, 175, 22, 23, 239, 25, 25, 68, 69, 70, /* 570 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - /* 580 */ 230, 82, 83, 84, 85, 86, 87, 88, 89, 90, - /* 590 */ 91, 92, 19, 215, 22, 23, 23, 25, 163, 194, - /* 600 */ 94, 166, 167, 168, 25, 138, 67, 7, 8, 9, - /* 610 */ 108, 206, 207, 169, 170, 171, 150, 22, 221, 222, - /* 620 */ 223, 26, 49, 50, 86, 87, 23, 161, 162, 23, - /* 630 */ 22, 165, 24, 120, 22, 23, 25, 160, 241, 67, - /* 640 */ 176, 68, 69, 70, 71, 72, 73, 74, 75, 76, - /* 650 */ 77, 78, 79, 80, 160, 82, 83, 84, 85, 86, - /* 660 */ 87, 88, 89, 90, 91, 92, 19, 129, 130, 150, - /* 670 */ 23, 194, 35, 23, 230, 25, 150, 155, 150, 67, - /* 680 */ 150, 105, 106, 107, 165, 221, 222, 223, 194, 94, - /* 690 */ 23, 165, 25, 165, 217, 165, 49, 50, 25, 173, - /* 700 */ 174, 173, 174, 173, 174, 0, 1, 2, 118, 221, - /* 710 */ 222, 223, 193, 219, 237, 68, 69, 70, 71, 72, + /* 580 */ 205, 82, 83, 84, 85, 86, 87, 88, 89, 90, + /* 590 */ 91, 92, 19, 22, 23, 216, 23, 222, 223, 224, + /* 600 */ 63, 220, 35, 150, 150, 163, 220, 67, 166, 167, + /* 610 */ 168, 150, 169, 170, 171, 161, 162, 25, 165, 165, + /* 620 */ 150, 113, 49, 50, 25, 117, 165, 174, 175, 35, + /* 630 */ 7, 8, 9, 160, 160, 165, 120, 100, 67, 247, + /* 640 */ 248, 68, 69, 70, 71, 72, 73, 74, 75, 76, + /* 650 */ 77, 78, 79, 80, 193, 82, 83, 84, 85, 86, + /* 660 */ 87, 88, 89, 90, 91, 92, 19, 194, 194, 150, + /* 670 */ 135, 24, 137, 35, 231, 138, 150, 129, 130, 206, + /* 680 */ 207, 30, 27, 213, 165, 34, 118, 95, 0, 1, + /* 690 */ 2, 165, 218, 174, 175, 50, 49, 50, 22, 48, + /* 700 */ 174, 175, 22, 23, 23, 244, 222, 223, 224, 166, + /* 710 */ 167, 168, 120, 239, 23, 68, 69, 70, 71, 72, /* 720 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82, /* 730 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - /* 740 */ 19, 150, 19, 165, 150, 24, 166, 167, 168, 227, - /* 750 */ 27, 173, 174, 231, 150, 25, 165, 150, 172, 165, - /* 760 */ 150, 242, 129, 130, 173, 174, 180, 173, 174, 165, - /* 770 */ 49, 50, 165, 150, 176, 165, 35, 173, 174, 165, - /* 780 */ 173, 174, 35, 23, 23, 25, 25, 173, 165, 68, + /* 740 */ 19, 150, 173, 165, 181, 182, 24, 67, 26, 104, + /* 750 */ 181, 188, 174, 175, 150, 39, 165, 150, 52, 150, + /* 760 */ 150, 150, 150, 144, 145, 174, 175, 249, 250, 165, + /* 770 */ 49, 50, 165, 52, 165, 165, 165, 165, 174, 175, + /* 780 */ 29, 174, 175, 174, 175, 174, 175, 160, 22, 68, /* 790 */ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, /* 800 */ 79, 80, 150, 82, 83, 84, 85, 86, 87, 88, - /* 810 */ 89, 90, 91, 92, 19, 150, 193, 165, 150, 221, - /* 820 */ 222, 223, 150, 213, 19, 173, 174, 23, 150, 97, - /* 830 */ 165, 150, 27, 165, 150, 150, 150, 165, 173, 174, - /* 840 */ 22, 173, 174, 165, 49, 50, 165, 52, 116, 165, - /* 850 */ 165, 165, 206, 207, 173, 174, 126, 50, 173, 174, - /* 860 */ 128, 27, 160, 68, 69, 70, 71, 72, 73, 74, + /* 810 */ 89, 90, 91, 92, 19, 150, 94, 165, 150, 150, + /* 820 */ 160, 194, 150, 213, 160, 52, 174, 175, 23, 23, + /* 830 */ 165, 25, 22, 165, 165, 150, 150, 165, 52, 174, + /* 840 */ 175, 22, 174, 175, 49, 50, 174, 175, 190, 191, + /* 850 */ 165, 165, 240, 23, 194, 25, 187, 109, 194, 174, + /* 860 */ 175, 190, 191, 68, 69, 70, 71, 72, 73, 74, /* 870 */ 75, 76, 77, 78, 79, 80, 150, 82, 83, 84, /* 880 */ 85, 86, 87, 88, 89, 90, 91, 92, 19, 150, - /* 890 */ 23, 165, 150, 23, 216, 25, 194, 32, 39, 173, - /* 900 */ 174, 135, 150, 137, 165, 150, 41, 165, 150, 52, - /* 910 */ 238, 104, 173, 174, 29, 173, 174, 165, 49, 50, - /* 920 */ 165, 219, 238, 165, 238, 173, 174, 52, 173, 174, - /* 930 */ 22, 173, 174, 23, 23, 160, 25, 68, 69, 70, + /* 890 */ 22, 165, 150, 23, 150, 25, 150, 166, 91, 92, + /* 900 */ 174, 175, 22, 217, 165, 150, 102, 165, 150, 165, + /* 910 */ 150, 165, 150, 174, 175, 19, 174, 175, 49, 50, + /* 920 */ 165, 86, 87, 165, 23, 165, 25, 165, 24, 174, + /* 930 */ 175, 187, 174, 175, 174, 175, 205, 68, 69, 70, /* 940 */ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, /* 950 */ 150, 82, 83, 84, 85, 86, 87, 88, 89, 90, - /* 960 */ 91, 92, 19, 150, 150, 165, 150, 245, 246, 194, - /* 970 */ 150, 144, 145, 173, 174, 160, 150, 22, 165, 165, - /* 980 */ 22, 165, 150, 150, 116, 165, 173, 174, 52, 173, - /* 990 */ 174, 165, 49, 50, 22, 150, 128, 165, 165, 173, - /* 1000 */ 174, 187, 166, 166, 22, 173, 174, 187, 109, 194, - /* 1010 */ 165, 68, 69, 70, 71, 72, 73, 74, 75, 76, + /* 960 */ 91, 92, 19, 150, 150, 165, 150, 150, 166, 23, + /* 970 */ 150, 25, 160, 20, 174, 175, 1, 2, 165, 165, + /* 980 */ 104, 165, 165, 43, 150, 165, 240, 150, 49, 50, + /* 990 */ 174, 175, 49, 50, 23, 23, 25, 25, 53, 165, + /* 1000 */ 187, 187, 165, 23, 187, 25, 194, 205, 174, 175, + /* 1010 */ 71, 72, 69, 70, 71, 72, 73, 74, 75, 76, /* 1020 */ 77, 78, 79, 80, 150, 82, 83, 84, 85, 86, - /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 150, 193, 165, - /* 1040 */ 102, 205, 205, 150, 150, 247, 248, 173, 174, 19, - /* 1050 */ 150, 20, 165, 150, 150, 150, 150, 150, 165, 165, - /* 1060 */ 173, 174, 49, 50, 104, 165, 49, 50, 165, 165, - /* 1070 */ 165, 165, 165, 173, 174, 43, 173, 174, 173, 174, - /* 1080 */ 187, 24, 190, 191, 71, 72, 69, 70, 71, 72, - /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 150, 82, + /* 1030 */ 87, 88, 89, 90, 91, 92, 19, 98, 150, 165, + /* 1040 */ 150, 160, 150, 59, 25, 53, 104, 22, 174, 175, + /* 1050 */ 213, 138, 5, 165, 1, 165, 150, 165, 150, 150, + /* 1060 */ 240, 150, 174, 175, 174, 175, 49, 50, 118, 150, + /* 1070 */ 35, 165, 27, 165, 165, 194, 165, 108, 127, 76, + /* 1080 */ 174, 175, 174, 175, 165, 174, 175, 70, 71, 72, + /* 1090 */ 73, 74, 75, 76, 77, 78, 79, 80, 166, 82, /* 1100 */ 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - /* 1110 */ 19, 98, 150, 165, 150, 150, 150, 150, 150, 150, - /* 1120 */ 59, 173, 174, 25, 150, 190, 191, 165, 53, 165, - /* 1130 */ 165, 165, 165, 165, 165, 173, 174, 173, 174, 165, - /* 1140 */ 49, 50, 91, 92, 1, 2, 53, 173, 174, 138, - /* 1150 */ 104, 22, 5, 1, 35, 118, 127, 150, 193, 193, - /* 1160 */ 193, 70, 71, 72, 73, 74, 75, 76, 77, 78, - /* 1170 */ 79, 80, 165, 82, 83, 84, 85, 86, 87, 88, - /* 1180 */ 89, 90, 91, 92, 19, 20, 150, 22, 150, 27, - /* 1190 */ 150, 26, 27, 108, 150, 22, 76, 76, 150, 25, - /* 1200 */ 193, 165, 37, 165, 150, 165, 22, 19, 20, 165, - /* 1210 */ 22, 173, 174, 165, 26, 27, 23, 150, 119, 165, - /* 1220 */ 150, 56, 150, 150, 150, 37, 16, 173, 174, 193, - /* 1230 */ 150, 66, 165, 193, 1, 165, 121, 165, 165, 165, - /* 1240 */ 20, 146, 147, 119, 56, 165, 150, 152, 16, 154, - /* 1250 */ 150, 86, 87, 88, 66, 160, 150, 150, 93, 94, - /* 1260 */ 95, 165, 150, 98, 108, 165, 127, 23, 65, 173, - /* 1270 */ 174, 165, 165, 150, 86, 87, 128, 165, 150, 173, - /* 1280 */ 174, 93, 94, 95, 23, 150, 98, 15, 165, 194, - /* 1290 */ 150, 140, 22, 165, 129, 130, 131, 132, 133, 134, - /* 1300 */ 165, 173, 174, 3, 116, 165, 19, 20, 150, 22, - /* 1310 */ 4, 150, 217, 26, 27, 179, 179, 129, 130, 131, - /* 1320 */ 132, 133, 134, 165, 37, 150, 165, 150, 164, 19, - /* 1330 */ 20, 150, 22, 246, 149, 249, 26, 27, 249, 244, - /* 1340 */ 165, 150, 165, 56, 6, 150, 165, 37, 173, 174, - /* 1350 */ 173, 174, 150, 66, 173, 174, 165, 149, 149, 13, - /* 1360 */ 165, 25, 150, 150, 150, 149, 56, 165, 150, 116, - /* 1370 */ 151, 150, 150, 86, 87, 150, 66, 165, 165, 165, - /* 1380 */ 93, 94, 95, 165, 150, 98, 165, 165, 151, 22, - /* 1390 */ 165, 194, 150, 26, 27, 150, 86, 87, 159, 165, - /* 1400 */ 199, 126, 123, 93, 94, 95, 200, 165, 98, 124, - /* 1410 */ 165, 122, 201, 125, 225, 135, 129, 130, 131, 132, - /* 1420 */ 133, 134, 5, 157, 157, 202, 118, 10, 11, 12, - /* 1430 */ 13, 14, 203, 66, 17, 104, 210, 121, 211, 129, - /* 1440 */ 130, 131, 132, 133, 134, 210, 175, 211, 31, 211, - /* 1450 */ 33, 210, 104, 86, 87, 47, 175, 183, 175, 42, - /* 1460 */ 103, 94, 178, 177, 22, 98, 175, 92, 228, 175, - /* 1470 */ 175, 228, 55, 183, 57, 178, 175, 156, 61, 18, - /* 1480 */ 157, 64, 156, 235, 157, 156, 45, 157, 236, 157, - /* 1490 */ 135, 156, 189, 68, 157, 218, 129, 130, 131, 22, - /* 1500 */ 189, 199, 157, 156, 192, 18, 192, 192, 199, 192, - /* 1510 */ 218, 189, 40, 157, 38, 157, 240, 157, 240, 153, - /* 1520 */ 196, 181, 105, 106, 107, 243, 198, 166, 111, 230, - /* 1530 */ 176, 226, 239, 116, 230, 176, 166, 166, 176, 148, - /* 1540 */ 199, 177, 209, 209, 166, 196, 239, 208, 185, 199, - /* 1550 */ 92, 209, 233, 173, 234, 182, 139, 173, 182, 191, - /* 1560 */ 195, 182, 250, 186, + /* 1110 */ 19, 20, 193, 22, 150, 150, 150, 26, 27, 76, + /* 1120 */ 150, 22, 1, 150, 119, 121, 217, 20, 37, 165, + /* 1130 */ 165, 165, 16, 19, 20, 165, 22, 205, 165, 119, + /* 1140 */ 26, 27, 108, 128, 150, 150, 150, 56, 150, 22, + /* 1150 */ 150, 37, 150, 127, 160, 23, 150, 66, 193, 165, + /* 1160 */ 165, 165, 16, 165, 23, 165, 150, 165, 174, 175, + /* 1170 */ 56, 165, 150, 65, 174, 175, 15, 86, 87, 88, + /* 1180 */ 66, 165, 140, 150, 93, 94, 95, 165, 194, 98, + /* 1190 */ 174, 175, 22, 3, 164, 193, 174, 175, 165, 150, + /* 1200 */ 86, 87, 4, 180, 150, 248, 251, 93, 94, 95, + /* 1210 */ 216, 180, 98, 251, 165, 221, 150, 149, 6, 165, + /* 1220 */ 129, 130, 131, 132, 133, 134, 193, 150, 174, 175, + /* 1230 */ 116, 165, 19, 20, 150, 22, 149, 151, 150, 26, + /* 1240 */ 27, 149, 165, 129, 130, 131, 132, 133, 134, 165, + /* 1250 */ 37, 174, 175, 165, 149, 19, 20, 13, 22, 150, + /* 1260 */ 150, 150, 26, 27, 146, 147, 151, 150, 25, 56, + /* 1270 */ 152, 159, 154, 37, 165, 165, 165, 193, 160, 66, + /* 1280 */ 116, 193, 165, 174, 175, 174, 175, 194, 199, 150, + /* 1290 */ 200, 126, 56, 124, 123, 150, 201, 122, 150, 86, + /* 1300 */ 87, 150, 66, 193, 165, 202, 93, 94, 95, 150, + /* 1310 */ 165, 98, 194, 165, 125, 22, 165, 150, 150, 26, + /* 1320 */ 27, 135, 86, 87, 165, 174, 175, 203, 226, 93, + /* 1330 */ 94, 95, 165, 165, 98, 150, 218, 150, 193, 157, + /* 1340 */ 118, 157, 129, 130, 131, 132, 133, 134, 5, 104, + /* 1350 */ 165, 211, 165, 10, 11, 12, 13, 14, 150, 66, + /* 1360 */ 17, 174, 175, 210, 246, 129, 130, 131, 132, 133, + /* 1370 */ 134, 150, 210, 165, 31, 121, 33, 150, 150, 86, + /* 1380 */ 87, 176, 174, 175, 150, 42, 165, 94, 211, 210, + /* 1390 */ 150, 98, 165, 165, 211, 174, 175, 150, 55, 165, + /* 1400 */ 57, 150, 174, 175, 61, 165, 150, 64, 174, 175, + /* 1410 */ 150, 150, 165, 150, 174, 175, 165, 104, 150, 184, + /* 1420 */ 150, 165, 129, 130, 131, 165, 165, 150, 165, 150, + /* 1430 */ 150, 176, 150, 165, 47, 165, 150, 150, 176, 103, + /* 1440 */ 150, 22, 165, 178, 165, 165, 179, 165, 105, 106, + /* 1450 */ 107, 165, 165, 229, 111, 165, 92, 176, 229, 116, + /* 1460 */ 184, 176, 179, 156, 176, 176, 18, 157, 156, 237, + /* 1470 */ 45, 157, 156, 135, 157, 157, 238, 156, 68, 157, + /* 1480 */ 189, 189, 139, 219, 22, 157, 18, 192, 192, 192, + /* 1490 */ 192, 189, 219, 199, 157, 242, 40, 157, 199, 242, + /* 1500 */ 153, 157, 38, 245, 196, 166, 232, 198, 177, 177, + /* 1510 */ 232, 227, 209, 178, 166, 182, 166, 148, 177, 177, + /* 1520 */ 209, 196, 177, 199, 209, 199, 166, 208, 92, 195, + /* 1530 */ 174, 174, 183, 252, 183, 183, 252, 191, 252, 235, + /* 1540 */ 186, 241, 241, 252, 186, 252, 252, 252, 252, 252, + /* 1550 */ 252, 252, 252, 252, 252, 252, 236, }; -#define YY_SHIFT_USE_DFLT (-70) -#define YY_SHIFT_COUNT (416) -#define YY_SHIFT_MIN (-69) -#define YY_SHIFT_MAX (1487) +#define YY_SHIFT_USE_DFLT (-74) +#define YY_SHIFT_COUNT (418) +#define YY_SHIFT_MIN (-73) +#define YY_SHIFT_MAX (1468) static const short yy_shift_ofst[] = { - /* 0 */ 1143, 1188, 1417, 1188, 1287, 1287, 138, 138, -2, -19, - /* 10 */ 1287, 1287, 1287, 1287, 347, 362, 129, 129, 795, 1165, - /* 20 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, - /* 30 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, - /* 40 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1310, 1287, - /* 50 */ 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, - /* 60 */ 1287, 1287, 286, 362, 362, 538, 538, 231, 1253, 55, - /* 70 */ 721, 647, 573, 499, 425, 351, 277, 203, 869, 869, - /* 80 */ 869, 869, 869, 869, 869, 869, 869, 869, 869, 869, - /* 90 */ 869, 869, 869, 943, 869, 1017, 1091, 1091, -69, -45, - /* 100 */ -45, -45, -45, -45, -1, 24, 245, 362, 362, 362, - /* 110 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, - /* 120 */ 362, 362, 362, 388, 356, 362, 362, 362, 362, 362, - /* 130 */ 732, 868, 231, 1051, 1458, -70, -70, -70, 1367, 57, - /* 140 */ 434, 434, 289, 291, 285, 1, 204, 572, 539, 362, - /* 150 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, - /* 160 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, - /* 170 */ 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, - /* 180 */ 362, 506, 506, 506, 705, 1253, 1253, 1253, -70, -70, - /* 190 */ -70, 171, 171, 160, 502, 502, 502, 446, 432, 511, - /* 200 */ 422, 358, 335, -12, -12, -12, -12, 576, 294, -12, - /* 210 */ -12, 295, 595, 141, 600, 730, 723, 723, 805, 730, - /* 220 */ 805, 439, 911, 231, 865, 231, 865, 807, 865, 723, - /* 230 */ 766, 633, 633, 231, 284, 63, 608, 1476, 1308, 1308, - /* 240 */ 1472, 1472, 1308, 1477, 1425, 1275, 1487, 1487, 1487, 1487, - /* 250 */ 1308, 1461, 1275, 1477, 1425, 1425, 1308, 1461, 1355, 1441, - /* 260 */ 1308, 1308, 1461, 1308, 1461, 1308, 1461, 1442, 1348, 1348, - /* 270 */ 1348, 1408, 1375, 1375, 1442, 1348, 1357, 1348, 1408, 1348, - /* 280 */ 1348, 1316, 1331, 1316, 1331, 1316, 1331, 1308, 1308, 1280, - /* 290 */ 1288, 1289, 1285, 1279, 1275, 1253, 1336, 1346, 1346, 1338, - /* 300 */ 1338, 1338, 1338, -70, -70, -70, -70, -70, -70, 1013, - /* 310 */ 467, 612, 84, 179, -28, 870, 410, 761, 760, 667, - /* 320 */ 650, 531, 220, 361, 331, 125, 127, 97, 1306, 1300, - /* 330 */ 1270, 1151, 1272, 1203, 1232, 1261, 1244, 1148, 1174, 1139, - /* 340 */ 1156, 1124, 1220, 1115, 1210, 1233, 1099, 1193, 1184, 1174, - /* 350 */ 1173, 1029, 1121, 1120, 1085, 1162, 1119, 1037, 1152, 1147, - /* 360 */ 1129, 1046, 1011, 1093, 1098, 1075, 1061, 1032, 960, 1057, - /* 370 */ 1031, 1030, 899, 938, 982, 936, 972, 958, 910, 955, - /* 380 */ 875, 885, 908, 857, 859, 867, 804, 590, 834, 747, - /* 390 */ 818, 513, 611, 741, 673, 637, 611, 606, 603, 579, - /* 400 */ 501, 541, 468, 386, 445, 395, 376, 281, 185, 120, - /* 410 */ 92, 75, 45, 114, 25, 11, 5, + /* 0 */ 975, 1114, 1343, 1114, 1213, 1213, 90, 90, 0, -19, + /* 10 */ 1213, 1213, 1213, 1213, 1213, 345, 445, 721, 1091, 1213, + /* 20 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, + /* 30 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, + /* 40 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1236, 1213, 1213, + /* 50 */ 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, 1213, + /* 60 */ 1213, 199, 445, 445, 835, 835, 365, 1164, 55, 647, + /* 70 */ 573, 499, 425, 351, 277, 203, 129, 795, 795, 795, + /* 80 */ 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, + /* 90 */ 795, 795, 795, 795, 795, 869, 795, 943, 1017, 1017, + /* 100 */ -69, -45, -45, -45, -45, -45, -1, 58, 138, 100, + /* 110 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, + /* 120 */ 445, 445, 445, 445, 445, 445, 537, 438, 445, 445, + /* 130 */ 445, 445, 445, 365, 807, 1436, -74, -74, -74, 1293, + /* 140 */ 73, 434, 434, 311, 314, 290, 283, 286, 540, 467, + /* 150 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, + /* 160 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, + /* 170 */ 445, 445, 445, 445, 445, 445, 445, 445, 445, 445, + /* 180 */ 445, 445, 65, 722, 722, 722, 688, 266, 1164, 1164, + /* 190 */ 1164, -74, -74, -74, 136, 168, 168, 234, 360, 360, + /* 200 */ 360, 430, 372, 435, 352, 278, 126, -36, -36, -36, + /* 210 */ -36, 421, 651, -36, -36, 592, 292, 212, 623, 158, + /* 220 */ 204, 204, 505, 158, 505, 144, 365, 154, 365, 154, + /* 230 */ 645, 154, 204, 154, 154, 535, 548, 548, 365, 387, + /* 240 */ 508, 233, 1464, 1222, 1222, 1456, 1456, 1222, 1462, 1410, + /* 250 */ 1165, 1468, 1468, 1468, 1468, 1222, 1165, 1462, 1410, 1410, + /* 260 */ 1222, 1448, 1338, 1425, 1222, 1222, 1448, 1222, 1448, 1222, + /* 270 */ 1448, 1419, 1313, 1313, 1313, 1387, 1364, 1364, 1419, 1313, + /* 280 */ 1336, 1313, 1387, 1313, 1313, 1254, 1245, 1254, 1245, 1254, + /* 290 */ 1245, 1222, 1222, 1186, 1189, 1175, 1169, 1171, 1165, 1164, + /* 300 */ 1243, 1244, 1244, 1212, 1212, 1212, 1212, -74, -74, -74, + /* 310 */ -74, -74, -74, 939, 104, 680, 571, 327, 1, 980, + /* 320 */ 26, 972, 971, 946, 901, 870, 830, 806, 54, 21, + /* 330 */ -73, 510, 242, 1198, 1190, 1170, 1042, 1161, 1108, 1146, + /* 340 */ 1141, 1132, 1015, 1127, 1026, 1034, 1020, 1107, 1004, 1116, + /* 350 */ 1121, 1005, 1099, 951, 1043, 1003, 969, 1045, 1035, 950, + /* 360 */ 1053, 1047, 1025, 942, 913, 992, 1019, 945, 984, 940, + /* 370 */ 876, 904, 953, 896, 748, 804, 880, 786, 868, 819, + /* 380 */ 805, 810, 773, 751, 766, 706, 716, 691, 681, 568, + /* 390 */ 655, 638, 676, 516, 541, 594, 599, 567, 541, 534, + /* 400 */ 507, 527, 498, 523, 466, 382, 409, 384, 357, 6, + /* 410 */ 240, 224, 143, 62, 18, 71, 39, 9, 5, }; -#define YY_REDUCE_USE_DFLT (-169) -#define YY_REDUCE_COUNT (308) -#define YY_REDUCE_MIN (-168) -#define YY_REDUCE_MAX (1391) +#define YY_REDUCE_USE_DFLT (-142) +#define YY_REDUCE_COUNT (312) +#define YY_REDUCE_MIN (-141) +#define YY_REDUCE_MAX (1369) static const short yy_reduce_ofst[] = { - /* 0 */ -141, 90, 1095, 222, 158, 156, 19, 17, 10, -104, - /* 10 */ 378, 316, 311, 12, 180, 249, 598, 464, 397, 1181, - /* 20 */ 1177, 1175, 1128, 1106, 1096, 1054, 1038, 974, 964, 962, - /* 30 */ 948, 905, 903, 900, 887, 874, 832, 826, 816, 813, - /* 40 */ 800, 758, 755, 752, 742, 739, 726, 685, 681, 668, - /* 50 */ 665, 652, 607, 604, 594, 591, 578, 530, 528, 526, - /* 60 */ 385, 18, 477, 466, 519, 444, 350, 435, 405, 488, - /* 70 */ 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, - /* 80 */ 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, - /* 90 */ 488, 488, 488, 488, 488, 488, 488, 488, 488, 488, - /* 100 */ 488, 488, 488, 488, 488, 488, 488, 1040, 678, 1036, - /* 110 */ 1007, 967, 966, 965, 845, 686, 610, 684, 317, 672, - /* 120 */ 893, 327, 623, 522, -7, 820, 814, 157, 154, 101, - /* 130 */ 702, 494, 580, 488, 488, 488, 488, 488, 614, 586, - /* 140 */ 935, 892, 968, 1245, 1242, 1234, 1225, 798, 798, 1222, - /* 150 */ 1221, 1218, 1214, 1213, 1212, 1202, 1195, 1191, 1161, 1158, - /* 160 */ 1140, 1135, 1123, 1112, 1107, 1100, 1080, 1074, 1073, 1072, - /* 170 */ 1070, 1067, 1048, 1044, 969, 968, 907, 906, 904, 894, - /* 180 */ 833, 837, 836, 340, 827, 815, 775, 68, 722, 646, - /* 190 */ -168, 1384, 1380, 1377, 1379, 1376, 1373, 1339, 1365, 1368, - /* 200 */ 1365, 1365, 1365, 1365, 1365, 1365, 1365, 1320, 1319, 1365, - /* 210 */ 1365, 1339, 1378, 1349, 1391, 1350, 1342, 1334, 1307, 1341, - /* 220 */ 1293, 1364, 1363, 1371, 1362, 1370, 1359, 1340, 1354, 1333, - /* 230 */ 1305, 1304, 1299, 1361, 1328, 1324, 1366, 1282, 1360, 1358, - /* 240 */ 1278, 1276, 1356, 1292, 1322, 1309, 1317, 1315, 1314, 1312, - /* 250 */ 1345, 1347, 1302, 1277, 1311, 1303, 1337, 1335, 1252, 1248, - /* 260 */ 1332, 1330, 1329, 1327, 1326, 1323, 1321, 1297, 1301, 1295, - /* 270 */ 1294, 1290, 1243, 1240, 1284, 1291, 1286, 1283, 1274, 1281, - /* 280 */ 1271, 1238, 1241, 1236, 1235, 1227, 1226, 1267, 1266, 1189, - /* 290 */ 1229, 1223, 1211, 1206, 1201, 1197, 1239, 1237, 1219, 1216, - /* 300 */ 1209, 1208, 1185, 1089, 1086, 1087, 1137, 1136, 1164, + /* 0 */ -141, 994, 1118, 223, 157, -53, 93, 89, 83, 375, + /* 10 */ 386, 381, 379, 308, 295, 325, -47, 27, 1240, 1234, + /* 20 */ 1228, 1221, 1208, 1187, 1151, 1111, 1109, 1077, 1054, 1022, + /* 30 */ 1016, 1000, 911, 908, 906, 890, 888, 874, 834, 816, + /* 40 */ 800, 760, 758, 755, 742, 739, 726, 685, 672, 668, + /* 50 */ 665, 652, 611, 609, 607, 604, 591, 578, 526, 519, + /* 60 */ 453, 474, 454, 461, 443, 245, 442, 473, 484, 484, + /* 70 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, + /* 80 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, + /* 90 */ 484, 484, 484, 484, 484, 484, 484, 484, 484, 484, + /* 100 */ 484, 484, 484, 484, 484, 484, 484, 130, 484, 484, + /* 110 */ 1145, 909, 1110, 1088, 1084, 1033, 1002, 965, 820, 837, + /* 120 */ 746, 686, 612, 817, 610, 919, 221, 563, 814, 813, + /* 130 */ 744, 669, 470, 543, 484, 484, 484, 484, 484, 291, + /* 140 */ 569, 671, 658, 970, 1290, 1287, 1286, 1282, 518, 518, + /* 150 */ 1280, 1279, 1277, 1270, 1268, 1263, 1261, 1260, 1256, 1251, + /* 160 */ 1247, 1227, 1185, 1168, 1167, 1159, 1148, 1139, 1117, 1066, + /* 170 */ 1049, 1006, 998, 996, 995, 973, 970, 966, 964, 892, + /* 180 */ 762, -52, 881, 932, 802, 731, 619, 812, 664, 660, + /* 190 */ 627, 392, 331, 124, 1358, 1357, 1356, 1354, 1352, 1351, + /* 200 */ 1349, 1319, 1334, 1346, 1334, 1334, 1334, 1334, 1334, 1334, + /* 210 */ 1334, 1320, 1304, 1334, 1334, 1319, 1360, 1325, 1369, 1326, + /* 220 */ 1315, 1311, 1301, 1324, 1300, 1335, 1350, 1345, 1348, 1342, + /* 230 */ 1333, 1341, 1303, 1332, 1331, 1284, 1278, 1274, 1339, 1309, + /* 240 */ 1308, 1347, 1258, 1344, 1340, 1257, 1253, 1337, 1273, 1302, + /* 250 */ 1299, 1298, 1297, 1296, 1295, 1328, 1294, 1264, 1292, 1291, + /* 260 */ 1322, 1321, 1238, 1232, 1318, 1317, 1316, 1314, 1312, 1310, + /* 270 */ 1307, 1283, 1289, 1288, 1285, 1276, 1229, 1224, 1267, 1281, + /* 280 */ 1265, 1262, 1235, 1255, 1205, 1183, 1179, 1177, 1162, 1140, + /* 290 */ 1153, 1184, 1182, 1102, 1124, 1103, 1095, 1090, 1089, 1093, + /* 300 */ 1112, 1115, 1086, 1105, 1092, 1087, 1068, 962, 955, 957, + /* 310 */ 1031, 1023, 1030, }; static const YYACTIONTYPE yy_default[] = { - /* 0 */ 632, 866, 954, 954, 866, 866, 954, 954, 954, 756, - /* 10 */ 954, 954, 954, 864, 954, 954, 784, 784, 928, 954, - /* 20 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 30 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 40 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 50 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 60 */ 954, 954, 954, 954, 954, 954, 954, 671, 760, 790, - /* 70 */ 954, 954, 954, 954, 954, 954, 954, 954, 927, 929, - /* 80 */ 798, 797, 907, 771, 795, 788, 792, 867, 860, 861, - /* 90 */ 859, 863, 868, 954, 791, 827, 844, 826, 838, 843, - /* 100 */ 850, 842, 839, 829, 828, 830, 831, 954, 954, 954, - /* 110 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 120 */ 954, 954, 954, 658, 725, 954, 954, 954, 954, 954, - /* 130 */ 954, 954, 954, 832, 833, 847, 846, 845, 954, 663, - /* 140 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 150 */ 934, 932, 954, 879, 954, 954, 954, 954, 954, 954, - /* 160 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 170 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 180 */ 638, 756, 756, 756, 632, 954, 954, 954, 946, 760, - /* 190 */ 750, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 200 */ 954, 954, 954, 800, 739, 917, 919, 954, 900, 737, - /* 210 */ 660, 758, 673, 748, 640, 794, 773, 773, 912, 794, - /* 220 */ 912, 696, 719, 954, 784, 954, 784, 693, 784, 773, - /* 230 */ 862, 954, 954, 954, 757, 748, 954, 939, 764, 764, - /* 240 */ 931, 931, 764, 806, 729, 794, 736, 736, 736, 736, - /* 250 */ 764, 655, 794, 806, 729, 729, 764, 655, 906, 904, - /* 260 */ 764, 764, 655, 764, 655, 764, 655, 872, 727, 727, - /* 270 */ 727, 711, 876, 876, 872, 727, 696, 727, 711, 727, - /* 280 */ 727, 777, 772, 777, 772, 777, 772, 764, 764, 954, - /* 290 */ 789, 778, 787, 785, 794, 954, 714, 648, 648, 637, - /* 300 */ 637, 637, 637, 951, 951, 946, 698, 698, 681, 954, - /* 310 */ 954, 954, 954, 954, 954, 954, 881, 954, 954, 954, - /* 320 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 633, - /* 330 */ 941, 954, 954, 938, 954, 954, 954, 954, 799, 954, - /* 340 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 916, - /* 350 */ 954, 954, 954, 954, 954, 954, 954, 910, 954, 954, - /* 360 */ 954, 954, 954, 954, 903, 902, 954, 954, 954, 954, - /* 370 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 380 */ 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, - /* 390 */ 954, 954, 786, 954, 779, 954, 865, 954, 954, 954, - /* 400 */ 954, 954, 954, 954, 954, 954, 954, 742, 815, 954, - /* 410 */ 814, 818, 813, 665, 954, 646, 954, 629, 634, 950, - /* 420 */ 953, 952, 949, 948, 947, 942, 940, 937, 936, 935, - /* 430 */ 933, 930, 926, 885, 883, 890, 889, 888, 887, 886, - /* 440 */ 884, 882, 880, 801, 796, 793, 925, 878, 738, 735, - /* 450 */ 734, 654, 943, 909, 918, 805, 804, 807, 915, 914, - /* 460 */ 913, 911, 908, 895, 803, 802, 730, 870, 869, 657, - /* 470 */ 899, 898, 897, 901, 905, 896, 766, 656, 653, 662, - /* 480 */ 717, 718, 726, 724, 723, 722, 721, 720, 716, 664, - /* 490 */ 672, 710, 695, 694, 875, 877, 874, 873, 703, 702, - /* 500 */ 708, 707, 706, 705, 704, 701, 700, 699, 692, 691, - /* 510 */ 697, 690, 713, 712, 709, 689, 733, 732, 731, 728, - /* 520 */ 688, 687, 686, 818, 685, 684, 824, 823, 811, 854, - /* 530 */ 753, 752, 751, 763, 762, 775, 774, 809, 808, 776, - /* 540 */ 761, 755, 754, 770, 769, 768, 767, 759, 749, 781, - /* 550 */ 783, 782, 780, 856, 765, 853, 924, 923, 922, 921, - /* 560 */ 920, 858, 857, 825, 822, 676, 677, 893, 892, 894, - /* 570 */ 891, 679, 678, 675, 674, 855, 744, 743, 851, 848, - /* 580 */ 840, 836, 852, 849, 841, 837, 835, 834, 820, 819, - /* 590 */ 817, 816, 812, 821, 667, 745, 741, 740, 810, 747, - /* 600 */ 746, 683, 682, 680, 661, 659, 652, 650, 649, 651, - /* 610 */ 647, 645, 644, 643, 642, 641, 670, 669, 668, 666, - /* 620 */ 665, 639, 636, 635, 631, 630, 628, + /* 0 */ 635, 870, 959, 959, 959, 870, 899, 899, 959, 759, + /* 10 */ 959, 959, 959, 959, 868, 959, 959, 933, 959, 959, + /* 20 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 30 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 40 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 50 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 60 */ 959, 959, 959, 959, 899, 899, 674, 763, 794, 959, + /* 70 */ 959, 959, 959, 959, 959, 959, 959, 932, 934, 809, + /* 80 */ 808, 802, 801, 912, 774, 799, 792, 785, 796, 871, + /* 90 */ 864, 865, 863, 867, 872, 959, 795, 831, 848, 830, + /* 100 */ 842, 847, 854, 846, 843, 833, 832, 666, 834, 835, + /* 110 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 120 */ 959, 959, 959, 959, 959, 959, 661, 728, 959, 959, + /* 130 */ 959, 959, 959, 959, 836, 837, 851, 850, 849, 959, + /* 140 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 150 */ 959, 939, 937, 959, 883, 959, 959, 959, 959, 959, + /* 160 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 170 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 180 */ 959, 641, 959, 759, 759, 759, 635, 959, 959, 959, + /* 190 */ 959, 951, 763, 753, 719, 959, 959, 959, 959, 959, + /* 200 */ 959, 959, 959, 959, 959, 959, 959, 804, 742, 922, + /* 210 */ 924, 959, 905, 740, 663, 761, 676, 751, 643, 798, + /* 220 */ 776, 776, 917, 798, 917, 700, 959, 788, 959, 788, + /* 230 */ 697, 788, 776, 788, 788, 866, 959, 959, 959, 760, + /* 240 */ 751, 959, 944, 767, 767, 936, 936, 767, 810, 732, + /* 250 */ 798, 739, 739, 739, 739, 767, 798, 810, 732, 732, + /* 260 */ 767, 658, 911, 909, 767, 767, 658, 767, 658, 767, + /* 270 */ 658, 876, 730, 730, 730, 715, 880, 880, 876, 730, + /* 280 */ 700, 730, 715, 730, 730, 780, 775, 780, 775, 780, + /* 290 */ 775, 767, 767, 959, 793, 781, 791, 789, 798, 959, + /* 300 */ 718, 651, 651, 640, 640, 640, 640, 956, 956, 951, + /* 310 */ 702, 702, 684, 959, 959, 959, 959, 959, 959, 959, + /* 320 */ 885, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 330 */ 959, 959, 959, 959, 636, 946, 959, 959, 943, 959, + /* 340 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 350 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 915, + /* 360 */ 959, 959, 959, 959, 959, 959, 908, 907, 959, 959, + /* 370 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 380 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 959, + /* 390 */ 959, 959, 959, 959, 790, 959, 782, 959, 869, 959, + /* 400 */ 959, 959, 959, 959, 959, 959, 959, 959, 959, 745, + /* 410 */ 819, 959, 818, 822, 817, 668, 959, 649, 959, 632, + /* 420 */ 637, 955, 958, 957, 954, 953, 952, 947, 945, 942, + /* 430 */ 941, 940, 938, 935, 931, 889, 887, 894, 893, 892, + /* 440 */ 891, 890, 888, 886, 884, 805, 803, 800, 797, 930, + /* 450 */ 882, 741, 738, 737, 657, 948, 914, 923, 921, 811, + /* 460 */ 920, 919, 918, 916, 913, 900, 807, 806, 733, 874, + /* 470 */ 873, 660, 904, 903, 902, 906, 910, 901, 769, 659, + /* 480 */ 656, 665, 722, 721, 729, 727, 726, 725, 724, 723, + /* 490 */ 720, 667, 675, 686, 714, 699, 698, 879, 881, 878, + /* 500 */ 877, 707, 706, 712, 711, 710, 709, 708, 705, 704, + /* 510 */ 703, 696, 695, 701, 694, 717, 716, 713, 693, 736, + /* 520 */ 735, 734, 731, 692, 691, 690, 822, 689, 688, 828, + /* 530 */ 827, 815, 858, 756, 755, 754, 766, 765, 778, 777, + /* 540 */ 813, 812, 779, 764, 758, 757, 773, 772, 771, 770, + /* 550 */ 762, 752, 784, 787, 786, 783, 860, 768, 857, 929, + /* 560 */ 928, 927, 926, 925, 862, 861, 829, 826, 679, 680, + /* 570 */ 898, 896, 897, 895, 682, 681, 678, 677, 859, 747, + /* 580 */ 746, 855, 852, 844, 840, 856, 853, 845, 841, 839, + /* 590 */ 838, 824, 823, 821, 820, 816, 825, 670, 748, 744, + /* 600 */ 743, 814, 750, 749, 687, 685, 683, 664, 662, 655, + /* 610 */ 653, 652, 654, 650, 648, 647, 646, 645, 644, 673, + /* 620 */ 672, 671, 669, 668, 642, 639, 638, 634, 633, 631, }; /* The next table maps tokens into fallback tokens. If a construct ** like the following: ** @@ -109184,30 +108530,30 @@ "create_table", "create_table_args", "createkw", "temp", "ifnotexists", "dbnm", "columnlist", "conslist_opt", "select", "column", "columnid", "type", "carglist", "id", "ids", "typetoken", "typename", "signed", "plus_num", "minus_num", - "ccons", "term", "expr", "onconf", - "sortorder", "autoinc", "idxlist_opt", "refargs", - "defer_subclause", "refarg", "refact", "init_deferred_pred_opt", - "conslist", "tconscomma", "tcons", "idxlist", + "carg", "ccons", "term", "expr", + "onconf", "sortorder", "autoinc", "idxlist_opt", + "refargs", "defer_subclause", "refarg", "refact", + "init_deferred_pred_opt", "conslist", "tcons", "idxlist", "defer_subclause_opt", "orconf", "resolvetype", "raisetype", "ifexists", "fullname", "oneselect", "multiselect_op", "distinct", "selcollist", "from", "where_opt", "groupby_opt", "having_opt", "orderby_opt", "limit_opt", "sclp", "as", "seltablist", "stl_prefix", "joinop", "indexed_opt", "on_opt", "using_opt", - "joinop2", "inscollist", "sortlist", "nexprlist", - "setlist", "insert_cmd", "inscollist_opt", "valuelist", - "exprlist", "likeop", "between_op", "in_op", - "case_operand", "case_exprlist", "case_else", "uniqueflag", - "collate", "nmnum", "number", "trigger_decl", - "trigger_cmd_list", "trigger_time", "trigger_event", "foreach_clause", - "when_clause", "trigger_cmd", "trnm", "tridxby", - "database_kw_opt", "key_opt", "add_column_fullname", "kwcolumn_opt", - "create_vtab", "vtabarglist", "vtabarg", "vtabargtoken", - "lp", "anylist", + "joinop2", "inscollist", "sortlist", "sortitem", + "nexprlist", "setlist", "insert_cmd", "inscollist_opt", + "itemlist", "exprlist", "likeop", "between_op", + "in_op", "case_operand", "case_exprlist", "case_else", + "uniqueflag", "collate", "nmnum", "plus_opt", + "number", "trigger_decl", "trigger_cmd_list", "trigger_time", + "trigger_event", "foreach_clause", "when_clause", "trigger_cmd", + "trnm", "tridxby", "database_kw_opt", "key_opt", + "add_column_fullname", "kwcolumn_opt", "create_vtab", "vtabarglist", + "vtabarg", "vtabargtoken", "lp", "anylist", }; #endif /* NDEBUG */ #ifndef NDEBUG /* For tracing reduce actions, the names of all rules are required. @@ -109264,50 +108610,50 @@ /* 48 */ "typetoken ::= typename LP signed COMMA signed RP", /* 49 */ "typename ::= ids", /* 50 */ "typename ::= typename ids", /* 51 */ "signed ::= plus_num", /* 52 */ "signed ::= minus_num", - /* 53 */ "carglist ::= carglist ccons", + /* 53 */ "carglist ::= carglist carg", /* 54 */ "carglist ::=", - /* 55 */ "ccons ::= CONSTRAINT nm", - /* 56 */ "ccons ::= DEFAULT term", - /* 57 */ "ccons ::= DEFAULT LP expr RP", - /* 58 */ "ccons ::= DEFAULT PLUS term", - /* 59 */ "ccons ::= DEFAULT MINUS term", - /* 60 */ "ccons ::= DEFAULT id", - /* 61 */ "ccons ::= NULL onconf", - /* 62 */ "ccons ::= NOT NULL onconf", - /* 63 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc", - /* 64 */ "ccons ::= UNIQUE onconf", - /* 65 */ "ccons ::= CHECK LP expr RP", - /* 66 */ "ccons ::= REFERENCES nm idxlist_opt refargs", - /* 67 */ "ccons ::= defer_subclause", - /* 68 */ "ccons ::= COLLATE ids", - /* 69 */ "autoinc ::=", - /* 70 */ "autoinc ::= AUTOINCR", - /* 71 */ "refargs ::=", - /* 72 */ "refargs ::= refargs refarg", - /* 73 */ "refarg ::= MATCH nm", - /* 74 */ "refarg ::= ON INSERT refact", - /* 75 */ "refarg ::= ON DELETE refact", - /* 76 */ "refarg ::= ON UPDATE refact", - /* 77 */ "refact ::= SET NULL", - /* 78 */ "refact ::= SET DEFAULT", - /* 79 */ "refact ::= CASCADE", - /* 80 */ "refact ::= RESTRICT", - /* 81 */ "refact ::= NO ACTION", - /* 82 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", - /* 83 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", - /* 84 */ "init_deferred_pred_opt ::=", - /* 85 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", - /* 86 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", - /* 87 */ "conslist_opt ::=", - /* 88 */ "conslist_opt ::= COMMA conslist", - /* 89 */ "conslist ::= conslist tconscomma tcons", - /* 90 */ "conslist ::= tcons", - /* 91 */ "tconscomma ::= COMMA", - /* 92 */ "tconscomma ::=", + /* 55 */ "carg ::= CONSTRAINT nm ccons", + /* 56 */ "carg ::= ccons", + /* 57 */ "ccons ::= DEFAULT term", + /* 58 */ "ccons ::= DEFAULT LP expr RP", + /* 59 */ "ccons ::= DEFAULT PLUS term", + /* 60 */ "ccons ::= DEFAULT MINUS term", + /* 61 */ "ccons ::= DEFAULT id", + /* 62 */ "ccons ::= NULL onconf", + /* 63 */ "ccons ::= NOT NULL onconf", + /* 64 */ "ccons ::= PRIMARY KEY sortorder onconf autoinc", + /* 65 */ "ccons ::= UNIQUE onconf", + /* 66 */ "ccons ::= CHECK LP expr RP", + /* 67 */ "ccons ::= REFERENCES nm idxlist_opt refargs", + /* 68 */ "ccons ::= defer_subclause", + /* 69 */ "ccons ::= COLLATE ids", + /* 70 */ "autoinc ::=", + /* 71 */ "autoinc ::= AUTOINCR", + /* 72 */ "refargs ::=", + /* 73 */ "refargs ::= refargs refarg", + /* 74 */ "refarg ::= MATCH nm", + /* 75 */ "refarg ::= ON INSERT refact", + /* 76 */ "refarg ::= ON DELETE refact", + /* 77 */ "refarg ::= ON UPDATE refact", + /* 78 */ "refact ::= SET NULL", + /* 79 */ "refact ::= SET DEFAULT", + /* 80 */ "refact ::= CASCADE", + /* 81 */ "refact ::= RESTRICT", + /* 82 */ "refact ::= NO ACTION", + /* 83 */ "defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt", + /* 84 */ "defer_subclause ::= DEFERRABLE init_deferred_pred_opt", + /* 85 */ "init_deferred_pred_opt ::=", + /* 86 */ "init_deferred_pred_opt ::= INITIALLY DEFERRED", + /* 87 */ "init_deferred_pred_opt ::= INITIALLY IMMEDIATE", + /* 88 */ "conslist_opt ::=", + /* 89 */ "conslist_opt ::= COMMA conslist", + /* 90 */ "conslist ::= conslist COMMA tcons", + /* 91 */ "conslist ::= conslist tcons", + /* 92 */ "conslist ::= tcons", /* 93 */ "tcons ::= CONSTRAINT nm", /* 94 */ "tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf", /* 95 */ "tcons ::= UNIQUE LP idxlist RP onconf", /* 96 */ "tcons ::= CHECK LP expr RP onconf", /* 97 */ "tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt", @@ -109364,184 +108710,186 @@ /* 148 */ "indexed_opt ::= NOT INDEXED", /* 149 */ "using_opt ::= USING LP inscollist RP", /* 150 */ "using_opt ::=", /* 151 */ "orderby_opt ::=", /* 152 */ "orderby_opt ::= ORDER BY sortlist", - /* 153 */ "sortlist ::= sortlist COMMA expr sortorder", - /* 154 */ "sortlist ::= expr sortorder", - /* 155 */ "sortorder ::= ASC", - /* 156 */ "sortorder ::= DESC", - /* 157 */ "sortorder ::=", - /* 158 */ "groupby_opt ::=", - /* 159 */ "groupby_opt ::= GROUP BY nexprlist", - /* 160 */ "having_opt ::=", - /* 161 */ "having_opt ::= HAVING expr", - /* 162 */ "limit_opt ::=", - /* 163 */ "limit_opt ::= LIMIT expr", - /* 164 */ "limit_opt ::= LIMIT expr OFFSET expr", - /* 165 */ "limit_opt ::= LIMIT expr COMMA expr", - /* 166 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", - /* 167 */ "where_opt ::=", - /* 168 */ "where_opt ::= WHERE expr", - /* 169 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", - /* 170 */ "setlist ::= setlist COMMA nm EQ expr", - /* 171 */ "setlist ::= nm EQ expr", - /* 172 */ "cmd ::= insert_cmd INTO fullname inscollist_opt valuelist", - /* 173 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", - /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", - /* 175 */ "insert_cmd ::= INSERT orconf", - /* 176 */ "insert_cmd ::= REPLACE", - /* 177 */ "valuelist ::= VALUES LP nexprlist RP", - /* 178 */ "valuelist ::= valuelist COMMA LP exprlist RP", - /* 179 */ "inscollist_opt ::=", - /* 180 */ "inscollist_opt ::= LP inscollist RP", - /* 181 */ "inscollist ::= inscollist COMMA nm", - /* 182 */ "inscollist ::= nm", - /* 183 */ "expr ::= term", - /* 184 */ "expr ::= LP expr RP", - /* 185 */ "term ::= NULL", - /* 186 */ "expr ::= id", - /* 187 */ "expr ::= JOIN_KW", - /* 188 */ "expr ::= nm DOT nm", - /* 189 */ "expr ::= nm DOT nm DOT nm", - /* 190 */ "term ::= INTEGER|FLOAT|BLOB", - /* 191 */ "term ::= STRING", - /* 192 */ "expr ::= REGISTER", - /* 193 */ "expr ::= VARIABLE", - /* 194 */ "expr ::= expr COLLATE ids", - /* 195 */ "expr ::= CAST LP expr AS typetoken RP", - /* 196 */ "expr ::= ID LP distinct exprlist RP", - /* 197 */ "expr ::= ID LP STAR RP", - /* 198 */ "term ::= CTIME_KW", - /* 199 */ "expr ::= expr AND expr", - /* 200 */ "expr ::= expr OR expr", - /* 201 */ "expr ::= expr LT|GT|GE|LE expr", - /* 202 */ "expr ::= expr EQ|NE expr", - /* 203 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", - /* 204 */ "expr ::= expr PLUS|MINUS expr", - /* 205 */ "expr ::= expr STAR|SLASH|REM expr", - /* 206 */ "expr ::= expr CONCAT expr", - /* 207 */ "likeop ::= LIKE_KW", - /* 208 */ "likeop ::= NOT LIKE_KW", - /* 209 */ "likeop ::= MATCH", - /* 210 */ "likeop ::= NOT MATCH", - /* 211 */ "expr ::= expr likeop expr", - /* 212 */ "expr ::= expr likeop expr ESCAPE expr", - /* 213 */ "expr ::= expr ISNULL|NOTNULL", - /* 214 */ "expr ::= expr NOT NULL", - /* 215 */ "expr ::= expr IS expr", - /* 216 */ "expr ::= expr IS NOT expr", - /* 217 */ "expr ::= NOT expr", - /* 218 */ "expr ::= BITNOT expr", - /* 219 */ "expr ::= MINUS expr", - /* 220 */ "expr ::= PLUS expr", - /* 221 */ "between_op ::= BETWEEN", - /* 222 */ "between_op ::= NOT BETWEEN", - /* 223 */ "expr ::= expr between_op expr AND expr", - /* 224 */ "in_op ::= IN", - /* 225 */ "in_op ::= NOT IN", - /* 226 */ "expr ::= expr in_op LP exprlist RP", - /* 227 */ "expr ::= LP select RP", - /* 228 */ "expr ::= expr in_op LP select RP", - /* 229 */ "expr ::= expr in_op nm dbnm", - /* 230 */ "expr ::= EXISTS LP select RP", - /* 231 */ "expr ::= CASE case_operand case_exprlist case_else END", - /* 232 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", - /* 233 */ "case_exprlist ::= WHEN expr THEN expr", - /* 234 */ "case_else ::= ELSE expr", - /* 235 */ "case_else ::=", - /* 236 */ "case_operand ::= expr", - /* 237 */ "case_operand ::=", - /* 238 */ "exprlist ::= nexprlist", - /* 239 */ "exprlist ::=", - /* 240 */ "nexprlist ::= nexprlist COMMA expr", - /* 241 */ "nexprlist ::= expr", - /* 242 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP", - /* 243 */ "uniqueflag ::= UNIQUE", - /* 244 */ "uniqueflag ::=", - /* 245 */ "idxlist_opt ::=", - /* 246 */ "idxlist_opt ::= LP idxlist RP", - /* 247 */ "idxlist ::= idxlist COMMA nm collate sortorder", - /* 248 */ "idxlist ::= nm collate sortorder", - /* 249 */ "collate ::=", - /* 250 */ "collate ::= COLLATE ids", - /* 251 */ "cmd ::= DROP INDEX ifexists fullname", - /* 252 */ "cmd ::= VACUUM", - /* 253 */ "cmd ::= VACUUM nm", - /* 254 */ "cmd ::= PRAGMA nm dbnm", - /* 255 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", - /* 256 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", - /* 257 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", - /* 258 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", - /* 259 */ "nmnum ::= plus_num", - /* 260 */ "nmnum ::= nm", - /* 261 */ "nmnum ::= ON", - /* 262 */ "nmnum ::= DELETE", - /* 263 */ "nmnum ::= DEFAULT", - /* 264 */ "plus_num ::= PLUS number", - /* 265 */ "plus_num ::= number", + /* 153 */ "sortlist ::= sortlist COMMA sortitem sortorder", + /* 154 */ "sortlist ::= sortitem sortorder", + /* 155 */ "sortitem ::= expr", + /* 156 */ "sortorder ::= ASC", + /* 157 */ "sortorder ::= DESC", + /* 158 */ "sortorder ::=", + /* 159 */ "groupby_opt ::=", + /* 160 */ "groupby_opt ::= GROUP BY nexprlist", + /* 161 */ "having_opt ::=", + /* 162 */ "having_opt ::= HAVING expr", + /* 163 */ "limit_opt ::=", + /* 164 */ "limit_opt ::= LIMIT expr", + /* 165 */ "limit_opt ::= LIMIT expr OFFSET expr", + /* 166 */ "limit_opt ::= LIMIT expr COMMA expr", + /* 167 */ "cmd ::= DELETE FROM fullname indexed_opt where_opt", + /* 168 */ "where_opt ::=", + /* 169 */ "where_opt ::= WHERE expr", + /* 170 */ "cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt", + /* 171 */ "setlist ::= setlist COMMA nm EQ expr", + /* 172 */ "setlist ::= nm EQ expr", + /* 173 */ "cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP", + /* 174 */ "cmd ::= insert_cmd INTO fullname inscollist_opt select", + /* 175 */ "cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES", + /* 176 */ "insert_cmd ::= INSERT orconf", + /* 177 */ "insert_cmd ::= REPLACE", + /* 178 */ "itemlist ::= itemlist COMMA expr", + /* 179 */ "itemlist ::= expr", + /* 180 */ "inscollist_opt ::=", + /* 181 */ "inscollist_opt ::= LP inscollist RP", + /* 182 */ "inscollist ::= inscollist COMMA nm", + /* 183 */ "inscollist ::= nm", + /* 184 */ "expr ::= term", + /* 185 */ "expr ::= LP expr RP", + /* 186 */ "term ::= NULL", + /* 187 */ "expr ::= id", + /* 188 */ "expr ::= JOIN_KW", + /* 189 */ "expr ::= nm DOT nm", + /* 190 */ "expr ::= nm DOT nm DOT nm", + /* 191 */ "term ::= INTEGER|FLOAT|BLOB", + /* 192 */ "term ::= STRING", + /* 193 */ "expr ::= REGISTER", + /* 194 */ "expr ::= VARIABLE", + /* 195 */ "expr ::= expr COLLATE ids", + /* 196 */ "expr ::= CAST LP expr AS typetoken RP", + /* 197 */ "expr ::= ID LP distinct exprlist RP", + /* 198 */ "expr ::= ID LP STAR RP", + /* 199 */ "term ::= CTIME_KW", + /* 200 */ "expr ::= expr AND expr", + /* 201 */ "expr ::= expr OR expr", + /* 202 */ "expr ::= expr LT|GT|GE|LE expr", + /* 203 */ "expr ::= expr EQ|NE expr", + /* 204 */ "expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr", + /* 205 */ "expr ::= expr PLUS|MINUS expr", + /* 206 */ "expr ::= expr STAR|SLASH|REM expr", + /* 207 */ "expr ::= expr CONCAT expr", + /* 208 */ "likeop ::= LIKE_KW", + /* 209 */ "likeop ::= NOT LIKE_KW", + /* 210 */ "likeop ::= MATCH", + /* 211 */ "likeop ::= NOT MATCH", + /* 212 */ "expr ::= expr likeop expr", + /* 213 */ "expr ::= expr likeop expr ESCAPE expr", + /* 214 */ "expr ::= expr ISNULL|NOTNULL", + /* 215 */ "expr ::= expr NOT NULL", + /* 216 */ "expr ::= expr IS expr", + /* 217 */ "expr ::= expr IS NOT expr", + /* 218 */ "expr ::= NOT expr", + /* 219 */ "expr ::= BITNOT expr", + /* 220 */ "expr ::= MINUS expr", + /* 221 */ "expr ::= PLUS expr", + /* 222 */ "between_op ::= BETWEEN", + /* 223 */ "between_op ::= NOT BETWEEN", + /* 224 */ "expr ::= expr between_op expr AND expr", + /* 225 */ "in_op ::= IN", + /* 226 */ "in_op ::= NOT IN", + /* 227 */ "expr ::= expr in_op LP exprlist RP", + /* 228 */ "expr ::= LP select RP", + /* 229 */ "expr ::= expr in_op LP select RP", + /* 230 */ "expr ::= expr in_op nm dbnm", + /* 231 */ "expr ::= EXISTS LP select RP", + /* 232 */ "expr ::= CASE case_operand case_exprlist case_else END", + /* 233 */ "case_exprlist ::= case_exprlist WHEN expr THEN expr", + /* 234 */ "case_exprlist ::= WHEN expr THEN expr", + /* 235 */ "case_else ::= ELSE expr", + /* 236 */ "case_else ::=", + /* 237 */ "case_operand ::= expr", + /* 238 */ "case_operand ::=", + /* 239 */ "exprlist ::= nexprlist", + /* 240 */ "exprlist ::=", + /* 241 */ "nexprlist ::= nexprlist COMMA expr", + /* 242 */ "nexprlist ::= expr", + /* 243 */ "cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP", + /* 244 */ "uniqueflag ::= UNIQUE", + /* 245 */ "uniqueflag ::=", + /* 246 */ "idxlist_opt ::=", + /* 247 */ "idxlist_opt ::= LP idxlist RP", + /* 248 */ "idxlist ::= idxlist COMMA nm collate sortorder", + /* 249 */ "idxlist ::= nm collate sortorder", + /* 250 */ "collate ::=", + /* 251 */ "collate ::= COLLATE ids", + /* 252 */ "cmd ::= DROP INDEX ifexists fullname", + /* 253 */ "cmd ::= VACUUM", + /* 254 */ "cmd ::= VACUUM nm", + /* 255 */ "cmd ::= PRAGMA nm dbnm", + /* 256 */ "cmd ::= PRAGMA nm dbnm EQ nmnum", + /* 257 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP", + /* 258 */ "cmd ::= PRAGMA nm dbnm EQ minus_num", + /* 259 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP", + /* 260 */ "nmnum ::= plus_num", + /* 261 */ "nmnum ::= nm", + /* 262 */ "nmnum ::= ON", + /* 263 */ "nmnum ::= DELETE", + /* 264 */ "nmnum ::= DEFAULT", + /* 265 */ "plus_num ::= plus_opt number", /* 266 */ "minus_num ::= MINUS number", /* 267 */ "number ::= INTEGER|FLOAT", - /* 268 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", - /* 269 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", - /* 270 */ "trigger_time ::= BEFORE", - /* 271 */ "trigger_time ::= AFTER", - /* 272 */ "trigger_time ::= INSTEAD OF", - /* 273 */ "trigger_time ::=", - /* 274 */ "trigger_event ::= DELETE|INSERT", - /* 275 */ "trigger_event ::= UPDATE", - /* 276 */ "trigger_event ::= UPDATE OF inscollist", - /* 277 */ "foreach_clause ::=", - /* 278 */ "foreach_clause ::= FOR EACH ROW", - /* 279 */ "when_clause ::=", - /* 280 */ "when_clause ::= WHEN expr", - /* 281 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", - /* 282 */ "trigger_cmd_list ::= trigger_cmd SEMI", - /* 283 */ "trnm ::= nm", - /* 284 */ "trnm ::= nm DOT nm", - /* 285 */ "tridxby ::=", - /* 286 */ "tridxby ::= INDEXED BY nm", - /* 287 */ "tridxby ::= NOT INDEXED", - /* 288 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt", - /* 289 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist", - /* 290 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select", - /* 291 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt", - /* 292 */ "trigger_cmd ::= select", - /* 293 */ "expr ::= RAISE LP IGNORE RP", - /* 294 */ "expr ::= RAISE LP raisetype COMMA nm RP", - /* 295 */ "raisetype ::= ROLLBACK", - /* 296 */ "raisetype ::= ABORT", - /* 297 */ "raisetype ::= FAIL", - /* 298 */ "cmd ::= DROP TRIGGER ifexists fullname", - /* 299 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", - /* 300 */ "cmd ::= DETACH database_kw_opt expr", - /* 301 */ "key_opt ::=", - /* 302 */ "key_opt ::= KEY expr", - /* 303 */ "database_kw_opt ::= DATABASE", - /* 304 */ "database_kw_opt ::=", - /* 305 */ "cmd ::= REINDEX", - /* 306 */ "cmd ::= REINDEX nm dbnm", - /* 307 */ "cmd ::= ANALYZE", - /* 308 */ "cmd ::= ANALYZE nm dbnm", - /* 309 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", - /* 310 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", - /* 311 */ "add_column_fullname ::= fullname", - /* 312 */ "kwcolumn_opt ::=", - /* 313 */ "kwcolumn_opt ::= COLUMNKW", - /* 314 */ "cmd ::= create_vtab", - /* 315 */ "cmd ::= create_vtab LP vtabarglist RP", - /* 316 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm", - /* 317 */ "vtabarglist ::= vtabarg", - /* 318 */ "vtabarglist ::= vtabarglist COMMA vtabarg", - /* 319 */ "vtabarg ::=", - /* 320 */ "vtabarg ::= vtabarg vtabargtoken", - /* 321 */ "vtabargtoken ::= ANY", - /* 322 */ "vtabargtoken ::= lp anylist RP", - /* 323 */ "lp ::= LP", - /* 324 */ "anylist ::=", - /* 325 */ "anylist ::= anylist LP anylist RP", - /* 326 */ "anylist ::= anylist ANY", + /* 268 */ "plus_opt ::= PLUS", + /* 269 */ "plus_opt ::=", + /* 270 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END", + /* 271 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause", + /* 272 */ "trigger_time ::= BEFORE", + /* 273 */ "trigger_time ::= AFTER", + /* 274 */ "trigger_time ::= INSTEAD OF", + /* 275 */ "trigger_time ::=", + /* 276 */ "trigger_event ::= DELETE|INSERT", + /* 277 */ "trigger_event ::= UPDATE", + /* 278 */ "trigger_event ::= UPDATE OF inscollist", + /* 279 */ "foreach_clause ::=", + /* 280 */ "foreach_clause ::= FOR EACH ROW", + /* 281 */ "when_clause ::=", + /* 282 */ "when_clause ::= WHEN expr", + /* 283 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI", + /* 284 */ "trigger_cmd_list ::= trigger_cmd SEMI", + /* 285 */ "trnm ::= nm", + /* 286 */ "trnm ::= nm DOT nm", + /* 287 */ "tridxby ::=", + /* 288 */ "tridxby ::= INDEXED BY nm", + /* 289 */ "tridxby ::= NOT INDEXED", + /* 290 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt", + /* 291 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP", + /* 292 */ "trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select", + /* 293 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt", + /* 294 */ "trigger_cmd ::= select", + /* 295 */ "expr ::= RAISE LP IGNORE RP", + /* 296 */ "expr ::= RAISE LP raisetype COMMA nm RP", + /* 297 */ "raisetype ::= ROLLBACK", + /* 298 */ "raisetype ::= ABORT", + /* 299 */ "raisetype ::= FAIL", + /* 300 */ "cmd ::= DROP TRIGGER ifexists fullname", + /* 301 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt", + /* 302 */ "cmd ::= DETACH database_kw_opt expr", + /* 303 */ "key_opt ::=", + /* 304 */ "key_opt ::= KEY expr", + /* 305 */ "database_kw_opt ::= DATABASE", + /* 306 */ "database_kw_opt ::=", + /* 307 */ "cmd ::= REINDEX", + /* 308 */ "cmd ::= REINDEX nm dbnm", + /* 309 */ "cmd ::= ANALYZE", + /* 310 */ "cmd ::= ANALYZE nm dbnm", + /* 311 */ "cmd ::= ALTER TABLE fullname RENAME TO nm", + /* 312 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column", + /* 313 */ "add_column_fullname ::= fullname", + /* 314 */ "kwcolumn_opt ::=", + /* 315 */ "kwcolumn_opt ::= COLUMNKW", + /* 316 */ "cmd ::= create_vtab", + /* 317 */ "cmd ::= create_vtab LP vtabarglist RP", + /* 318 */ "create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm", + /* 319 */ "vtabarglist ::= vtabarg", + /* 320 */ "vtabarglist ::= vtabarglist COMMA vtabarg", + /* 321 */ "vtabarg ::=", + /* 322 */ "vtabarg ::= vtabarg vtabargtoken", + /* 323 */ "vtabargtoken ::= ANY", + /* 324 */ "vtabargtoken ::= lp anylist RP", + /* 325 */ "lp ::= LP", + /* 326 */ "anylist ::=", + /* 327 */ "anylist ::= anylist LP anylist RP", + /* 328 */ "anylist ::= anylist ANY", }; #endif /* NDEBUG */ #if YYSTACKDEPTH<=0 @@ -109619,77 +108967,71 @@ ** inside the C code. */ case 160: /* select */ case 194: /* oneselect */ { -sqlite3SelectDelete(pParse->db, (yypminor->yy159)); +sqlite3SelectDelete(pParse->db, (yypminor->yy387)); } break; - case 173: /* term */ - case 174: /* expr */ + case 174: /* term */ + case 175: /* expr */ { -sqlite3ExprDelete(pParse->db, (yypminor->yy342).pExpr); +sqlite3ExprDelete(pParse->db, (yypminor->yy118).pExpr); } break; - case 178: /* idxlist_opt */ + case 179: /* idxlist_opt */ case 187: /* idxlist */ case 197: /* selcollist */ case 200: /* groupby_opt */ case 202: /* orderby_opt */ case 204: /* sclp */ case 214: /* sortlist */ - case 215: /* nexprlist */ - case 216: /* setlist */ - case 220: /* exprlist */ - case 225: /* case_exprlist */ + case 216: /* nexprlist */ + case 217: /* setlist */ + case 220: /* itemlist */ + case 221: /* exprlist */ + case 226: /* case_exprlist */ { -sqlite3ExprListDelete(pParse->db, (yypminor->yy442)); +sqlite3ExprListDelete(pParse->db, (yypminor->yy322)); } break; case 193: /* fullname */ case 198: /* from */ case 206: /* seltablist */ case 207: /* stl_prefix */ { -sqlite3SrcListDelete(pParse->db, (yypminor->yy347)); +sqlite3SrcListDelete(pParse->db, (yypminor->yy259)); } break; case 199: /* where_opt */ case 201: /* having_opt */ case 210: /* on_opt */ - case 224: /* case_operand */ - case 226: /* case_else */ - case 236: /* when_clause */ - case 241: /* key_opt */ + case 215: /* sortitem */ + case 225: /* case_operand */ + case 227: /* case_else */ + case 238: /* when_clause */ + case 243: /* key_opt */ { -sqlite3ExprDelete(pParse->db, (yypminor->yy122)); +sqlite3ExprDelete(pParse->db, (yypminor->yy314)); } break; case 211: /* using_opt */ case 213: /* inscollist */ - case 218: /* inscollist_opt */ -{ -sqlite3IdListDelete(pParse->db, (yypminor->yy180)); -} - break; - case 219: /* valuelist */ -{ - - sqlite3ExprListDelete(pParse->db, (yypminor->yy487).pList); - sqlite3SelectDelete(pParse->db, (yypminor->yy487).pSelect); - -} - break; - case 232: /* trigger_cmd_list */ - case 237: /* trigger_cmd */ -{ -sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy327)); -} - break; - case 234: /* trigger_event */ -{ -sqlite3IdListDelete(pParse->db, (yypminor->yy410).b); + case 219: /* inscollist_opt */ +{ +sqlite3IdListDelete(pParse->db, (yypminor->yy384)); +} + break; + case 234: /* trigger_cmd_list */ + case 239: /* trigger_cmd */ +{ +sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy203)); +} + break; + case 236: /* trigger_event */ +{ +sqlite3IdListDelete(pParse->db, (yypminor->yy90).b); } break; default: break; /* If no destructor action specified: do nothing */ } } @@ -109985,57 +109327,57 @@ { 168, 2 }, { 169, 1 }, { 169, 1 }, { 164, 2 }, { 164, 0 }, - { 172, 2 }, - { 172, 2 }, - { 172, 4 }, - { 172, 3 }, - { 172, 3 }, - { 172, 2 }, - { 172, 2 }, - { 172, 3 }, - { 172, 5 }, - { 172, 2 }, - { 172, 4 }, - { 172, 4 }, - { 172, 1 }, - { 172, 2 }, - { 177, 0 }, - { 177, 1 }, - { 179, 0 }, - { 179, 2 }, - { 181, 2 }, - { 181, 3 }, - { 181, 3 }, - { 181, 3 }, - { 182, 2 }, - { 182, 2 }, - { 182, 1 }, - { 182, 1 }, - { 182, 2 }, - { 180, 3 }, - { 180, 2 }, - { 183, 0 }, - { 183, 2 }, - { 183, 2 }, + { 172, 3 }, + { 172, 1 }, + { 173, 2 }, + { 173, 4 }, + { 173, 3 }, + { 173, 3 }, + { 173, 2 }, + { 173, 2 }, + { 173, 3 }, + { 173, 5 }, + { 173, 2 }, + { 173, 4 }, + { 173, 4 }, + { 173, 1 }, + { 173, 2 }, + { 178, 0 }, + { 178, 1 }, + { 180, 0 }, + { 180, 2 }, + { 182, 2 }, + { 182, 3 }, + { 182, 3 }, + { 182, 3 }, + { 183, 2 }, + { 183, 2 }, + { 183, 1 }, + { 183, 1 }, + { 183, 2 }, + { 181, 3 }, + { 181, 2 }, + { 184, 0 }, + { 184, 2 }, + { 184, 2 }, { 159, 0 }, { 159, 2 }, - { 184, 3 }, - { 184, 1 }, + { 185, 3 }, + { 185, 2 }, { 185, 1 }, - { 185, 0 }, { 186, 2 }, { 186, 7 }, { 186, 5 }, { 186, 5 }, { 186, 10 }, { 188, 0 }, { 188, 1 }, - { 175, 0 }, - { 175, 3 }, + { 176, 0 }, + { 176, 3 }, { 189, 0 }, { 189, 2 }, { 190, 1 }, { 190, 1 }, { 190, 1 }, @@ -110085,13 +109427,14 @@ { 211, 0 }, { 202, 0 }, { 202, 3 }, { 214, 4 }, { 214, 2 }, - { 176, 1 }, - { 176, 1 }, - { 176, 0 }, + { 215, 1 }, + { 177, 1 }, + { 177, 1 }, + { 177, 0 }, { 200, 0 }, { 200, 3 }, { 201, 0 }, { 201, 2 }, { 203, 0 }, @@ -110100,167 +109443,168 @@ { 203, 4 }, { 147, 5 }, { 199, 0 }, { 199, 2 }, { 147, 7 }, - { 216, 5 }, - { 216, 3 }, - { 147, 5 }, + { 217, 5 }, + { 217, 3 }, + { 147, 8 }, { 147, 5 }, { 147, 6 }, - { 217, 2 }, - { 217, 1 }, - { 219, 4 }, - { 219, 5 }, - { 218, 0 }, - { 218, 3 }, + { 218, 2 }, + { 218, 1 }, + { 220, 3 }, + { 220, 1 }, + { 219, 0 }, + { 219, 3 }, { 213, 3 }, { 213, 1 }, - { 174, 1 }, - { 174, 3 }, - { 173, 1 }, - { 174, 1 }, - { 174, 1 }, - { 174, 3 }, - { 174, 5 }, - { 173, 1 }, - { 173, 1 }, - { 174, 1 }, - { 174, 1 }, - { 174, 3 }, - { 174, 6 }, - { 174, 5 }, - { 174, 4 }, - { 173, 1 }, - { 174, 3 }, - { 174, 3 }, - { 174, 3 }, - { 174, 3 }, - { 174, 3 }, - { 174, 3 }, - { 174, 3 }, - { 174, 3 }, - { 221, 1 }, - { 221, 2 }, - { 221, 1 }, - { 221, 2 }, - { 174, 3 }, - { 174, 5 }, - { 174, 2 }, - { 174, 3 }, - { 174, 3 }, - { 174, 4 }, - { 174, 2 }, - { 174, 2 }, - { 174, 2 }, - { 174, 2 }, + { 175, 1 }, + { 175, 3 }, + { 174, 1 }, + { 175, 1 }, + { 175, 1 }, + { 175, 3 }, + { 175, 5 }, + { 174, 1 }, + { 174, 1 }, + { 175, 1 }, + { 175, 1 }, + { 175, 3 }, + { 175, 6 }, + { 175, 5 }, + { 175, 4 }, + { 174, 1 }, + { 175, 3 }, + { 175, 3 }, + { 175, 3 }, + { 175, 3 }, + { 175, 3 }, + { 175, 3 }, + { 175, 3 }, + { 175, 3 }, + { 222, 1 }, + { 222, 2 }, { 222, 1 }, { 222, 2 }, - { 174, 5 }, + { 175, 3 }, + { 175, 5 }, + { 175, 2 }, + { 175, 3 }, + { 175, 3 }, + { 175, 4 }, + { 175, 2 }, + { 175, 2 }, + { 175, 2 }, + { 175, 2 }, { 223, 1 }, { 223, 2 }, - { 174, 5 }, - { 174, 3 }, - { 174, 5 }, - { 174, 4 }, - { 174, 4 }, - { 174, 5 }, - { 225, 5 }, - { 225, 4 }, - { 226, 2 }, - { 226, 0 }, + { 175, 5 }, { 224, 1 }, - { 224, 0 }, - { 220, 1 }, - { 220, 0 }, - { 215, 3 }, - { 215, 1 }, - { 147, 11 }, - { 227, 1 }, + { 224, 2 }, + { 175, 5 }, + { 175, 3 }, + { 175, 5 }, + { 175, 4 }, + { 175, 4 }, + { 175, 5 }, + { 226, 5 }, + { 226, 4 }, + { 227, 2 }, { 227, 0 }, - { 178, 0 }, - { 178, 3 }, + { 225, 1 }, + { 225, 0 }, + { 221, 1 }, + { 221, 0 }, + { 216, 3 }, + { 216, 1 }, + { 147, 11 }, + { 228, 1 }, + { 228, 0 }, + { 179, 0 }, + { 179, 3 }, { 187, 5 }, { 187, 3 }, - { 228, 0 }, - { 228, 2 }, + { 229, 0 }, + { 229, 2 }, { 147, 4 }, { 147, 1 }, { 147, 2 }, { 147, 3 }, { 147, 5 }, { 147, 6 }, { 147, 5 }, { 147, 6 }, - { 229, 1 }, - { 229, 1 }, - { 229, 1 }, - { 229, 1 }, - { 229, 1 }, + { 230, 1 }, + { 230, 1 }, + { 230, 1 }, + { 230, 1 }, + { 230, 1 }, { 170, 2 }, - { 170, 1 }, { 171, 2 }, - { 230, 1 }, + { 232, 1 }, + { 231, 1 }, + { 231, 0 }, { 147, 5 }, - { 231, 11 }, - { 233, 1 }, - { 233, 1 }, - { 233, 2 }, - { 233, 0 }, - { 234, 1 }, - { 234, 1 }, - { 234, 3 }, + { 233, 11 }, + { 235, 1 }, + { 235, 1 }, + { 235, 2 }, { 235, 0 }, - { 235, 3 }, - { 236, 0 }, - { 236, 2 }, - { 232, 3 }, - { 232, 2 }, - { 238, 1 }, - { 238, 3 }, - { 239, 0 }, - { 239, 3 }, - { 239, 2 }, - { 237, 7 }, - { 237, 5 }, - { 237, 5 }, - { 237, 5 }, - { 237, 1 }, - { 174, 4 }, - { 174, 6 }, + { 236, 1 }, + { 236, 1 }, + { 236, 3 }, + { 237, 0 }, + { 237, 3 }, + { 238, 0 }, + { 238, 2 }, + { 234, 3 }, + { 234, 2 }, + { 240, 1 }, + { 240, 3 }, + { 241, 0 }, + { 241, 3 }, + { 241, 2 }, + { 239, 7 }, + { 239, 8 }, + { 239, 5 }, + { 239, 5 }, + { 239, 1 }, + { 175, 4 }, + { 175, 6 }, { 191, 1 }, { 191, 1 }, { 191, 1 }, { 147, 4 }, { 147, 6 }, { 147, 3 }, - { 241, 0 }, - { 241, 2 }, - { 240, 1 }, - { 240, 0 }, + { 243, 0 }, + { 243, 2 }, + { 242, 1 }, + { 242, 0 }, { 147, 1 }, { 147, 3 }, { 147, 1 }, { 147, 3 }, { 147, 6 }, { 147, 6 }, - { 242, 1 }, - { 243, 0 }, - { 243, 1 }, + { 244, 1 }, + { 245, 0 }, + { 245, 1 }, { 147, 1 }, { 147, 4 }, - { 244, 8 }, - { 245, 1 }, - { 245, 3 }, - { 246, 0 }, - { 246, 2 }, + { 246, 7 }, { 247, 1 }, { 247, 3 }, - { 248, 1 }, - { 249, 0 }, - { 249, 4 }, - { 249, 2 }, + { 248, 0 }, + { 248, 2 }, + { 249, 1 }, + { 249, 3 }, + { 250, 1 }, + { 251, 0 }, + { 251, 4 }, + { 251, 2 }, }; static void yy_accept(yyParser*); /* Forward Declaration */ /* @@ -110324,21 +109668,21 @@ break; case 8: /* cmdx ::= cmd */ { sqlite3FinishCoding(pParse); } break; case 9: /* cmd ::= BEGIN transtype trans_opt */ -{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy392);} +{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy4);} break; case 13: /* transtype ::= */ -{yygotominor.yy392 = TK_DEFERRED;} +{yygotominor.yy4 = TK_DEFERRED;} break; case 14: /* transtype ::= DEFERRED */ case 15: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==15); case 16: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==16); case 115: /* multiselect_op ::= UNION */ yytestcase(yyruleno==115); case 117: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==117); -{yygotominor.yy392 = yymsp[0].major;} +{yygotominor.yy4 = yymsp[0].major;} break; case 17: /* cmd ::= COMMIT trans_opt */ case 18: /* cmd ::= END trans_opt */ yytestcase(yyruleno==18); {sqlite3CommitTransaction(pParse);} break; @@ -110360,11 +109704,11 @@ sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &yymsp[0].minor.yy0); } break; case 26: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */ { - sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy392,0,0,yymsp[-2].minor.yy392); + sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy4,0,0,yymsp[-2].minor.yy4); } break; case 27: /* createkw ::= CREATE */ { pParse->db->lookaside.bEnabled = 0; @@ -110371,41 +109715,41 @@ yygotominor.yy0 = yymsp[0].minor.yy0; } break; case 28: /* ifnotexists ::= */ case 31: /* temp ::= */ yytestcase(yyruleno==31); - case 69: /* autoinc ::= */ yytestcase(yyruleno==69); - case 82: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==82); - case 84: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==84); - case 86: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==86); + case 70: /* autoinc ::= */ yytestcase(yyruleno==70); + case 83: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */ yytestcase(yyruleno==83); + case 85: /* init_deferred_pred_opt ::= */ yytestcase(yyruleno==85); + case 87: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */ yytestcase(yyruleno==87); case 98: /* defer_subclause_opt ::= */ yytestcase(yyruleno==98); case 109: /* ifexists ::= */ yytestcase(yyruleno==109); case 120: /* distinct ::= ALL */ yytestcase(yyruleno==120); case 121: /* distinct ::= */ yytestcase(yyruleno==121); - case 221: /* between_op ::= BETWEEN */ yytestcase(yyruleno==221); - case 224: /* in_op ::= IN */ yytestcase(yyruleno==224); -{yygotominor.yy392 = 0;} + case 222: /* between_op ::= BETWEEN */ yytestcase(yyruleno==222); + case 225: /* in_op ::= IN */ yytestcase(yyruleno==225); +{yygotominor.yy4 = 0;} break; case 29: /* ifnotexists ::= IF NOT EXISTS */ case 30: /* temp ::= TEMP */ yytestcase(yyruleno==30); - case 70: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==70); - case 85: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==85); + case 71: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==71); + case 86: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */ yytestcase(yyruleno==86); case 108: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==108); case 119: /* distinct ::= DISTINCT */ yytestcase(yyruleno==119); - case 222: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==222); - case 225: /* in_op ::= NOT IN */ yytestcase(yyruleno==225); -{yygotominor.yy392 = 1;} + case 223: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==223); + case 226: /* in_op ::= NOT IN */ yytestcase(yyruleno==226); +{yygotominor.yy4 = 1;} break; case 32: /* create_table_args ::= LP columnlist conslist_opt RP */ { sqlite3EndTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0); } break; case 33: /* create_table_args ::= AS select */ { - sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy159); - sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159); + sqlite3EndTable(pParse,0,0,yymsp[0].minor.yy387); + sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); } break; case 36: /* column ::= columnid type carglist */ { yygotominor.yy0.z = yymsp[-2].minor.yy0.z; @@ -110414,11 +109758,10 @@ break; case 37: /* columnid ::= nm */ { sqlite3AddColumn(pParse,&yymsp[0].minor.yy0); yygotominor.yy0 = yymsp[0].minor.yy0; - pParse->constraintName.n = 0; } break; case 38: /* id ::= ID */ case 39: /* id ::= INDEXED */ yytestcase(yyruleno==39); case 40: /* ids ::= ID|STRING */ yytestcase(yyruleno==40); @@ -110429,21 +109772,20 @@ case 49: /* typename ::= ids */ yytestcase(yyruleno==49); case 127: /* as ::= AS nm */ yytestcase(yyruleno==127); case 128: /* as ::= ids */ yytestcase(yyruleno==128); case 138: /* dbnm ::= DOT nm */ yytestcase(yyruleno==138); case 147: /* indexed_opt ::= INDEXED BY nm */ yytestcase(yyruleno==147); - case 250: /* collate ::= COLLATE ids */ yytestcase(yyruleno==250); - case 259: /* nmnum ::= plus_num */ yytestcase(yyruleno==259); - case 260: /* nmnum ::= nm */ yytestcase(yyruleno==260); - case 261: /* nmnum ::= ON */ yytestcase(yyruleno==261); - case 262: /* nmnum ::= DELETE */ yytestcase(yyruleno==262); - case 263: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==263); - case 264: /* plus_num ::= PLUS number */ yytestcase(yyruleno==264); - case 265: /* plus_num ::= number */ yytestcase(yyruleno==265); + case 251: /* collate ::= COLLATE ids */ yytestcase(yyruleno==251); + case 260: /* nmnum ::= plus_num */ yytestcase(yyruleno==260); + case 261: /* nmnum ::= nm */ yytestcase(yyruleno==261); + case 262: /* nmnum ::= ON */ yytestcase(yyruleno==262); + case 263: /* nmnum ::= DELETE */ yytestcase(yyruleno==263); + case 264: /* nmnum ::= DEFAULT */ yytestcase(yyruleno==264); + case 265: /* plus_num ::= plus_opt number */ yytestcase(yyruleno==265); case 266: /* minus_num ::= MINUS number */ yytestcase(yyruleno==266); case 267: /* number ::= INTEGER|FLOAT */ yytestcase(yyruleno==267); - case 283: /* trnm ::= nm */ yytestcase(yyruleno==283); + case 285: /* trnm ::= nm */ yytestcase(yyruleno==285); {yygotominor.yy0 = yymsp[0].minor.yy0;} break; case 45: /* type ::= typetoken */ {sqlite3AddColumnType(pParse,&yymsp[0].minor.yy0);} break; @@ -110460,952 +109802,921 @@ } break; case 50: /* typename ::= typename ids */ {yygotominor.yy0.z=yymsp[-1].minor.yy0.z; yygotominor.yy0.n=yymsp[0].minor.yy0.n+(int)(yymsp[0].minor.yy0.z-yymsp[-1].minor.yy0.z);} break; - case 55: /* ccons ::= CONSTRAINT nm */ - case 93: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==93); -{pParse->constraintName = yymsp[0].minor.yy0;} - break; - case 56: /* ccons ::= DEFAULT term */ - case 58: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==58); -{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy342);} - break; - case 57: /* ccons ::= DEFAULT LP expr RP */ -{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy342);} - break; - case 59: /* ccons ::= DEFAULT MINUS term */ + case 57: /* ccons ::= DEFAULT term */ + case 59: /* ccons ::= DEFAULT PLUS term */ yytestcase(yyruleno==59); +{sqlite3AddDefaultValue(pParse,&yymsp[0].minor.yy118);} + break; + case 58: /* ccons ::= DEFAULT LP expr RP */ +{sqlite3AddDefaultValue(pParse,&yymsp[-1].minor.yy118);} + break; + case 60: /* ccons ::= DEFAULT MINUS term */ { ExprSpan v; - v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy342.pExpr, 0, 0); + v.pExpr = sqlite3PExpr(pParse, TK_UMINUS, yymsp[0].minor.yy118.pExpr, 0, 0); v.zStart = yymsp[-1].minor.yy0.z; - v.zEnd = yymsp[0].minor.yy342.zEnd; + v.zEnd = yymsp[0].minor.yy118.zEnd; sqlite3AddDefaultValue(pParse,&v); } break; - case 60: /* ccons ::= DEFAULT id */ + case 61: /* ccons ::= DEFAULT id */ { ExprSpan v; spanExpr(&v, pParse, TK_STRING, &yymsp[0].minor.yy0); sqlite3AddDefaultValue(pParse,&v); } break; - case 62: /* ccons ::= NOT NULL onconf */ -{sqlite3AddNotNull(pParse, yymsp[0].minor.yy392);} - break; - case 63: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ -{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy392,yymsp[0].minor.yy392,yymsp[-2].minor.yy392);} - break; - case 64: /* ccons ::= UNIQUE onconf */ -{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy392,0,0,0,0);} - break; - case 65: /* ccons ::= CHECK LP expr RP */ -{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy342.pExpr);} - break; - case 66: /* ccons ::= REFERENCES nm idxlist_opt refargs */ -{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy442,yymsp[0].minor.yy392);} - break; - case 67: /* ccons ::= defer_subclause */ -{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy392);} - break; - case 68: /* ccons ::= COLLATE ids */ + case 63: /* ccons ::= NOT NULL onconf */ +{sqlite3AddNotNull(pParse, yymsp[0].minor.yy4);} + break; + case 64: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */ +{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy4,yymsp[0].minor.yy4,yymsp[-2].minor.yy4);} + break; + case 65: /* ccons ::= UNIQUE onconf */ +{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy4,0,0,0,0);} + break; + case 66: /* ccons ::= CHECK LP expr RP */ +{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy118.pExpr);} + break; + case 67: /* ccons ::= REFERENCES nm idxlist_opt refargs */ +{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy322,yymsp[0].minor.yy4);} + break; + case 68: /* ccons ::= defer_subclause */ +{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy4);} + break; + case 69: /* ccons ::= COLLATE ids */ {sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);} break; - case 71: /* refargs ::= */ -{ yygotominor.yy392 = OE_None*0x0101; /* EV: R-19803-45884 */} - break; - case 72: /* refargs ::= refargs refarg */ -{ yygotominor.yy392 = (yymsp[-1].minor.yy392 & ~yymsp[0].minor.yy207.mask) | yymsp[0].minor.yy207.value; } - break; - case 73: /* refarg ::= MATCH nm */ - case 74: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==74); -{ yygotominor.yy207.value = 0; yygotominor.yy207.mask = 0x000000; } - break; - case 75: /* refarg ::= ON DELETE refact */ -{ yygotominor.yy207.value = yymsp[0].minor.yy392; yygotominor.yy207.mask = 0x0000ff; } - break; - case 76: /* refarg ::= ON UPDATE refact */ -{ yygotominor.yy207.value = yymsp[0].minor.yy392<<8; yygotominor.yy207.mask = 0x00ff00; } - break; - case 77: /* refact ::= SET NULL */ -{ yygotominor.yy392 = OE_SetNull; /* EV: R-33326-45252 */} - break; - case 78: /* refact ::= SET DEFAULT */ -{ yygotominor.yy392 = OE_SetDflt; /* EV: R-33326-45252 */} - break; - case 79: /* refact ::= CASCADE */ -{ yygotominor.yy392 = OE_Cascade; /* EV: R-33326-45252 */} - break; - case 80: /* refact ::= RESTRICT */ -{ yygotominor.yy392 = OE_Restrict; /* EV: R-33326-45252 */} - break; - case 81: /* refact ::= NO ACTION */ -{ yygotominor.yy392 = OE_None; /* EV: R-33326-45252 */} - break; - case 83: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ + case 72: /* refargs ::= */ +{ yygotominor.yy4 = OE_None*0x0101; /* EV: R-19803-45884 */} + break; + case 73: /* refargs ::= refargs refarg */ +{ yygotominor.yy4 = (yymsp[-1].minor.yy4 & ~yymsp[0].minor.yy215.mask) | yymsp[0].minor.yy215.value; } + break; + case 74: /* refarg ::= MATCH nm */ + case 75: /* refarg ::= ON INSERT refact */ yytestcase(yyruleno==75); +{ yygotominor.yy215.value = 0; yygotominor.yy215.mask = 0x000000; } + break; + case 76: /* refarg ::= ON DELETE refact */ +{ yygotominor.yy215.value = yymsp[0].minor.yy4; yygotominor.yy215.mask = 0x0000ff; } + break; + case 77: /* refarg ::= ON UPDATE refact */ +{ yygotominor.yy215.value = yymsp[0].minor.yy4<<8; yygotominor.yy215.mask = 0x00ff00; } + break; + case 78: /* refact ::= SET NULL */ +{ yygotominor.yy4 = OE_SetNull; /* EV: R-33326-45252 */} + break; + case 79: /* refact ::= SET DEFAULT */ +{ yygotominor.yy4 = OE_SetDflt; /* EV: R-33326-45252 */} + break; + case 80: /* refact ::= CASCADE */ +{ yygotominor.yy4 = OE_Cascade; /* EV: R-33326-45252 */} + break; + case 81: /* refact ::= RESTRICT */ +{ yygotominor.yy4 = OE_Restrict; /* EV: R-33326-45252 */} + break; + case 82: /* refact ::= NO ACTION */ +{ yygotominor.yy4 = OE_None; /* EV: R-33326-45252 */} + break; + case 84: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */ case 99: /* defer_subclause_opt ::= defer_subclause */ yytestcase(yyruleno==99); case 101: /* onconf ::= ON CONFLICT resolvetype */ yytestcase(yyruleno==101); case 104: /* resolvetype ::= raisetype */ yytestcase(yyruleno==104); -{yygotominor.yy392 = yymsp[0].minor.yy392;} +{yygotominor.yy4 = yymsp[0].minor.yy4;} break; - case 87: /* conslist_opt ::= */ + case 88: /* conslist_opt ::= */ {yygotominor.yy0.n = 0; yygotominor.yy0.z = 0;} break; - case 88: /* conslist_opt ::= COMMA conslist */ + case 89: /* conslist_opt ::= COMMA conslist */ {yygotominor.yy0 = yymsp[-1].minor.yy0;} break; - case 91: /* tconscomma ::= COMMA */ -{pParse->constraintName.n = 0;} - break; case 94: /* tcons ::= PRIMARY KEY LP idxlist autoinc RP onconf */ -{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy442,yymsp[0].minor.yy392,yymsp[-2].minor.yy392,0);} +{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy322,yymsp[0].minor.yy4,yymsp[-2].minor.yy4,0);} break; case 95: /* tcons ::= UNIQUE LP idxlist RP onconf */ -{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy442,yymsp[0].minor.yy392,0,0,0,0);} +{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy322,yymsp[0].minor.yy4,0,0,0,0);} break; case 96: /* tcons ::= CHECK LP expr RP onconf */ -{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy342.pExpr);} +{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy118.pExpr);} break; case 97: /* tcons ::= FOREIGN KEY LP idxlist RP REFERENCES nm idxlist_opt refargs defer_subclause_opt */ { - sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy442, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy442, yymsp[-1].minor.yy392); - sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy392); + sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy322, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy322, yymsp[-1].minor.yy4); + sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy4); } break; case 100: /* onconf ::= */ -{yygotominor.yy392 = OE_Default;} +{yygotominor.yy4 = OE_Default;} break; case 102: /* orconf ::= */ -{yygotominor.yy258 = OE_Default;} +{yygotominor.yy210 = OE_Default;} break; case 103: /* orconf ::= OR resolvetype */ -{yygotominor.yy258 = (u8)yymsp[0].minor.yy392;} +{yygotominor.yy210 = (u8)yymsp[0].minor.yy4;} break; case 105: /* resolvetype ::= IGNORE */ -{yygotominor.yy392 = OE_Ignore;} +{yygotominor.yy4 = OE_Ignore;} break; case 106: /* resolvetype ::= REPLACE */ -{yygotominor.yy392 = OE_Replace;} +{yygotominor.yy4 = OE_Replace;} break; case 107: /* cmd ::= DROP TABLE ifexists fullname */ { - sqlite3DropTable(pParse, yymsp[0].minor.yy347, 0, yymsp[-1].minor.yy392); + sqlite3DropTable(pParse, yymsp[0].minor.yy259, 0, yymsp[-1].minor.yy4); } break; case 110: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm AS select */ { - sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy159, yymsp[-6].minor.yy392, yymsp[-4].minor.yy392); + sqlite3CreateView(pParse, &yymsp[-7].minor.yy0, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, yymsp[0].minor.yy387, yymsp[-6].minor.yy4, yymsp[-4].minor.yy4); } break; case 111: /* cmd ::= DROP VIEW ifexists fullname */ { - sqlite3DropTable(pParse, yymsp[0].minor.yy347, 1, yymsp[-1].minor.yy392); + sqlite3DropTable(pParse, yymsp[0].minor.yy259, 1, yymsp[-1].minor.yy4); } break; case 112: /* cmd ::= select */ { SelectDest dest = {SRT_Output, 0, 0, 0, 0}; - sqlite3Select(pParse, yymsp[0].minor.yy159, &dest); + sqlite3Select(pParse, yymsp[0].minor.yy387, &dest); sqlite3ExplainBegin(pParse->pVdbe); - sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy159); + sqlite3ExplainSelect(pParse->pVdbe, yymsp[0].minor.yy387); sqlite3ExplainFinish(pParse->pVdbe); - sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy159); + sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy387); } break; case 113: /* select ::= oneselect */ -{yygotominor.yy159 = yymsp[0].minor.yy159;} +{yygotominor.yy387 = yymsp[0].minor.yy387;} break; case 114: /* select ::= select multiselect_op oneselect */ { - if( yymsp[0].minor.yy159 ){ - yymsp[0].minor.yy159->op = (u8)yymsp[-1].minor.yy392; - yymsp[0].minor.yy159->pPrior = yymsp[-2].minor.yy159; + if( yymsp[0].minor.yy387 ){ + yymsp[0].minor.yy387->op = (u8)yymsp[-1].minor.yy4; + yymsp[0].minor.yy387->pPrior = yymsp[-2].minor.yy387; }else{ - sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy159); + sqlite3SelectDelete(pParse->db, yymsp[-2].minor.yy387); } - yygotominor.yy159 = yymsp[0].minor.yy159; + yygotominor.yy387 = yymsp[0].minor.yy387; } break; case 116: /* multiselect_op ::= UNION ALL */ -{yygotominor.yy392 = TK_ALL;} +{yygotominor.yy4 = TK_ALL;} break; case 118: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */ { - yygotominor.yy159 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy442,yymsp[-5].minor.yy347,yymsp[-4].minor.yy122,yymsp[-3].minor.yy442,yymsp[-2].minor.yy122,yymsp[-1].minor.yy442,yymsp[-7].minor.yy392,yymsp[0].minor.yy64.pLimit,yymsp[0].minor.yy64.pOffset); + yygotominor.yy387 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy322,yymsp[-5].minor.yy259,yymsp[-4].minor.yy314,yymsp[-3].minor.yy322,yymsp[-2].minor.yy314,yymsp[-1].minor.yy322,yymsp[-7].minor.yy4,yymsp[0].minor.yy292.pLimit,yymsp[0].minor.yy292.pOffset); } break; case 122: /* sclp ::= selcollist COMMA */ - case 246: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==246); -{yygotominor.yy442 = yymsp[-1].minor.yy442;} + case 247: /* idxlist_opt ::= LP idxlist RP */ yytestcase(yyruleno==247); +{yygotominor.yy322 = yymsp[-1].minor.yy322;} break; case 123: /* sclp ::= */ case 151: /* orderby_opt ::= */ yytestcase(yyruleno==151); - case 158: /* groupby_opt ::= */ yytestcase(yyruleno==158); - case 239: /* exprlist ::= */ yytestcase(yyruleno==239); - case 245: /* idxlist_opt ::= */ yytestcase(yyruleno==245); -{yygotominor.yy442 = 0;} + case 159: /* groupby_opt ::= */ yytestcase(yyruleno==159); + case 240: /* exprlist ::= */ yytestcase(yyruleno==240); + case 246: /* idxlist_opt ::= */ yytestcase(yyruleno==246); +{yygotominor.yy322 = 0;} break; case 124: /* selcollist ::= sclp expr as */ { - yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy442, yymsp[-1].minor.yy342.pExpr); - if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[0].minor.yy0, 1); - sqlite3ExprListSetSpan(pParse,yygotominor.yy442,&yymsp[-1].minor.yy342); + yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy322, yymsp[-1].minor.yy118.pExpr); + if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[0].minor.yy0, 1); + sqlite3ExprListSetSpan(pParse,yygotominor.yy322,&yymsp[-1].minor.yy118); } break; case 125: /* selcollist ::= sclp STAR */ { Expr *p = sqlite3Expr(pParse->db, TK_ALL, 0); - yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy442, p); + yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-1].minor.yy322, p); } break; case 126: /* selcollist ::= sclp nm DOT STAR */ { Expr *pRight = sqlite3PExpr(pParse, TK_ALL, 0, 0, &yymsp[0].minor.yy0); Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); - yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442, pDot); + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322, pDot); } break; case 129: /* as ::= */ {yygotominor.yy0.n = 0;} break; case 130: /* from ::= */ -{yygotominor.yy347 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy347));} +{yygotominor.yy259 = sqlite3DbMallocZero(pParse->db, sizeof(*yygotominor.yy259));} break; case 131: /* from ::= FROM seltablist */ { - yygotominor.yy347 = yymsp[0].minor.yy347; - sqlite3SrcListShiftJoinType(yygotominor.yy347); + yygotominor.yy259 = yymsp[0].minor.yy259; + sqlite3SrcListShiftJoinType(yygotominor.yy259); } break; case 132: /* stl_prefix ::= seltablist joinop */ { - yygotominor.yy347 = yymsp[-1].minor.yy347; - if( ALWAYS(yygotominor.yy347 && yygotominor.yy347->nSrc>0) ) yygotominor.yy347->a[yygotominor.yy347->nSrc-1].jointype = (u8)yymsp[0].minor.yy392; + yygotominor.yy259 = yymsp[-1].minor.yy259; + if( ALWAYS(yygotominor.yy259 && yygotominor.yy259->nSrc>0) ) yygotominor.yy259->a[yygotominor.yy259->nSrc-1].jointype = (u8)yymsp[0].minor.yy4; } break; case 133: /* stl_prefix ::= */ -{yygotominor.yy347 = 0;} +{yygotominor.yy259 = 0;} break; case 134: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */ { - yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy122,yymsp[0].minor.yy180); - sqlite3SrcListIndexedBy(pParse, yygotominor.yy347, &yymsp[-2].minor.yy0); + yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); + sqlite3SrcListIndexedBy(pParse, yygotominor.yy259, &yymsp[-2].minor.yy0); } break; case 135: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */ { - yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy159,yymsp[-1].minor.yy122,yymsp[0].minor.yy180); + yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy387,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); } break; case 136: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */ { - if( yymsp[-6].minor.yy347==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy122==0 && yymsp[0].minor.yy180==0 ){ - yygotominor.yy347 = yymsp[-4].minor.yy347; + if( yymsp[-6].minor.yy259==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy314==0 && yymsp[0].minor.yy384==0 ){ + yygotominor.yy259 = yymsp[-4].minor.yy259; }else{ Select *pSubquery; - sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy347); - pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy347,0,0,0,0,0,0,0); - yygotominor.yy347 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy347,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy122,yymsp[0].minor.yy180); + sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy259); + pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy259,0,0,0,0,0,0,0); + yygotominor.yy259 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy259,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy314,yymsp[0].minor.yy384); } } break; case 137: /* dbnm ::= */ case 146: /* indexed_opt ::= */ yytestcase(yyruleno==146); {yygotominor.yy0.z=0; yygotominor.yy0.n=0;} break; case 139: /* fullname ::= nm dbnm */ -{yygotominor.yy347 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} +{yygotominor.yy259 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0);} break; case 140: /* joinop ::= COMMA|JOIN */ -{ yygotominor.yy392 = JT_INNER; } +{ yygotominor.yy4 = JT_INNER; } break; case 141: /* joinop ::= JOIN_KW JOIN */ -{ yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } +{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); } break; case 142: /* joinop ::= JOIN_KW nm JOIN */ -{ yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } +{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); } break; case 143: /* joinop ::= JOIN_KW nm nm JOIN */ -{ yygotominor.yy392 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } +{ yygotominor.yy4 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0); } break; case 144: /* on_opt ::= ON expr */ - case 161: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==161); - case 168: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==168); - case 234: /* case_else ::= ELSE expr */ yytestcase(yyruleno==234); - case 236: /* case_operand ::= expr */ yytestcase(yyruleno==236); -{yygotominor.yy122 = yymsp[0].minor.yy342.pExpr;} + case 155: /* sortitem ::= expr */ yytestcase(yyruleno==155); + case 162: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==162); + case 169: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==169); + case 235: /* case_else ::= ELSE expr */ yytestcase(yyruleno==235); + case 237: /* case_operand ::= expr */ yytestcase(yyruleno==237); +{yygotominor.yy314 = yymsp[0].minor.yy118.pExpr;} break; case 145: /* on_opt ::= */ - case 160: /* having_opt ::= */ yytestcase(yyruleno==160); - case 167: /* where_opt ::= */ yytestcase(yyruleno==167); - case 235: /* case_else ::= */ yytestcase(yyruleno==235); - case 237: /* case_operand ::= */ yytestcase(yyruleno==237); -{yygotominor.yy122 = 0;} + case 161: /* having_opt ::= */ yytestcase(yyruleno==161); + case 168: /* where_opt ::= */ yytestcase(yyruleno==168); + case 236: /* case_else ::= */ yytestcase(yyruleno==236); + case 238: /* case_operand ::= */ yytestcase(yyruleno==238); +{yygotominor.yy314 = 0;} break; case 148: /* indexed_opt ::= NOT INDEXED */ {yygotominor.yy0.z=0; yygotominor.yy0.n=1;} break; case 149: /* using_opt ::= USING LP inscollist RP */ - case 180: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==180); -{yygotominor.yy180 = yymsp[-1].minor.yy180;} + case 181: /* inscollist_opt ::= LP inscollist RP */ yytestcase(yyruleno==181); +{yygotominor.yy384 = yymsp[-1].minor.yy384;} break; case 150: /* using_opt ::= */ - case 179: /* inscollist_opt ::= */ yytestcase(yyruleno==179); -{yygotominor.yy180 = 0;} + case 180: /* inscollist_opt ::= */ yytestcase(yyruleno==180); +{yygotominor.yy384 = 0;} break; case 152: /* orderby_opt ::= ORDER BY sortlist */ - case 159: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==159); - case 238: /* exprlist ::= nexprlist */ yytestcase(yyruleno==238); -{yygotominor.yy442 = yymsp[0].minor.yy442;} - break; - case 153: /* sortlist ::= sortlist COMMA expr sortorder */ -{ - yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy442,yymsp[-1].minor.yy342.pExpr); - if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392; -} - break; - case 154: /* sortlist ::= expr sortorder */ -{ - yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy342.pExpr); - if( yygotominor.yy442 && ALWAYS(yygotominor.yy442->a) ) yygotominor.yy442->a[0].sortOrder = (u8)yymsp[0].minor.yy392; -} - break; - case 155: /* sortorder ::= ASC */ - case 157: /* sortorder ::= */ yytestcase(yyruleno==157); -{yygotominor.yy392 = SQLITE_SO_ASC;} - break; - case 156: /* sortorder ::= DESC */ -{yygotominor.yy392 = SQLITE_SO_DESC;} - break; - case 162: /* limit_opt ::= */ -{yygotominor.yy64.pLimit = 0; yygotominor.yy64.pOffset = 0;} - break; - case 163: /* limit_opt ::= LIMIT expr */ -{yygotominor.yy64.pLimit = yymsp[0].minor.yy342.pExpr; yygotominor.yy64.pOffset = 0;} - break; - case 164: /* limit_opt ::= LIMIT expr OFFSET expr */ -{yygotominor.yy64.pLimit = yymsp[-2].minor.yy342.pExpr; yygotominor.yy64.pOffset = yymsp[0].minor.yy342.pExpr;} - break; - case 165: /* limit_opt ::= LIMIT expr COMMA expr */ -{yygotominor.yy64.pOffset = yymsp[-2].minor.yy342.pExpr; yygotominor.yy64.pLimit = yymsp[0].minor.yy342.pExpr;} - break; - case 166: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ -{ - sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy347, &yymsp[-1].minor.yy0); - sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy347,yymsp[0].minor.yy122); -} - break; - case 169: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ -{ - sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy347, &yymsp[-3].minor.yy0); - sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy442,"set list"); - sqlite3Update(pParse,yymsp[-4].minor.yy347,yymsp[-1].minor.yy442,yymsp[0].minor.yy122,yymsp[-5].minor.yy258); -} - break; - case 170: /* setlist ::= setlist COMMA nm EQ expr */ -{ - yygotominor.yy442 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy442, yymsp[0].minor.yy342.pExpr); - sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[-2].minor.yy0, 1); -} - break; - case 171: /* setlist ::= nm EQ expr */ -{ - yygotominor.yy442 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy342.pExpr); - sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[-2].minor.yy0, 1); -} - break; - case 172: /* cmd ::= insert_cmd INTO fullname inscollist_opt valuelist */ -{sqlite3Insert(pParse, yymsp[-2].minor.yy347, yymsp[0].minor.yy487.pList, yymsp[0].minor.yy487.pSelect, yymsp[-1].minor.yy180, yymsp[-4].minor.yy258);} - break; - case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ -{sqlite3Insert(pParse, yymsp[-2].minor.yy347, 0, yymsp[0].minor.yy159, yymsp[-1].minor.yy180, yymsp[-4].minor.yy258);} - break; - case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ -{sqlite3Insert(pParse, yymsp[-3].minor.yy347, 0, 0, yymsp[-2].minor.yy180, yymsp[-5].minor.yy258);} - break; - case 175: /* insert_cmd ::= INSERT orconf */ -{yygotominor.yy258 = yymsp[0].minor.yy258;} - break; - case 176: /* insert_cmd ::= REPLACE */ -{yygotominor.yy258 = OE_Replace;} - break; - case 177: /* valuelist ::= VALUES LP nexprlist RP */ -{ - yygotominor.yy487.pList = yymsp[-1].minor.yy442; - yygotominor.yy487.pSelect = 0; -} - break; - case 178: /* valuelist ::= valuelist COMMA LP exprlist RP */ -{ - Select *pRight = sqlite3SelectNew(pParse, yymsp[-1].minor.yy442, 0, 0, 0, 0, 0, 0, 0, 0); - if( yymsp[-4].minor.yy487.pList ){ - yymsp[-4].minor.yy487.pSelect = sqlite3SelectNew(pParse, yymsp[-4].minor.yy487.pList, 0, 0, 0, 0, 0, 0, 0, 0); - yymsp[-4].minor.yy487.pList = 0; - } - yygotominor.yy487.pList = 0; - if( yymsp[-4].minor.yy487.pSelect==0 || pRight==0 ){ - sqlite3SelectDelete(pParse->db, pRight); - sqlite3SelectDelete(pParse->db, yymsp[-4].minor.yy487.pSelect); - yygotominor.yy487.pSelect = 0; - }else{ - pRight->op = TK_ALL; - pRight->pPrior = yymsp[-4].minor.yy487.pSelect; - pRight->selFlags |= SF_Values; - pRight->pPrior->selFlags |= SF_Values; - yygotominor.yy487.pSelect = pRight; - } -} - break; - case 181: /* inscollist ::= inscollist COMMA nm */ -{yygotominor.yy180 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy180,&yymsp[0].minor.yy0);} - break; - case 182: /* inscollist ::= nm */ -{yygotominor.yy180 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} - break; - case 183: /* expr ::= term */ -{yygotominor.yy342 = yymsp[0].minor.yy342;} - break; - case 184: /* expr ::= LP expr RP */ -{yygotominor.yy342.pExpr = yymsp[-1].minor.yy342.pExpr; spanSet(&yygotominor.yy342,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);} - break; - case 185: /* term ::= NULL */ - case 190: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==190); - case 191: /* term ::= STRING */ yytestcase(yyruleno==191); -{spanExpr(&yygotominor.yy342, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} - break; - case 186: /* expr ::= id */ - case 187: /* expr ::= JOIN_KW */ yytestcase(yyruleno==187); -{spanExpr(&yygotominor.yy342, pParse, TK_ID, &yymsp[0].minor.yy0);} - break; - case 188: /* expr ::= nm DOT nm */ + case 160: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==160); + case 239: /* exprlist ::= nexprlist */ yytestcase(yyruleno==239); +{yygotominor.yy322 = yymsp[0].minor.yy322;} + break; + case 153: /* sortlist ::= sortlist COMMA sortitem sortorder */ +{ + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy322,yymsp[-1].minor.yy314); + if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; +} + break; + case 154: /* sortlist ::= sortitem sortorder */ +{ + yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy314); + if( yygotominor.yy322 && ALWAYS(yygotominor.yy322->a) ) yygotominor.yy322->a[0].sortOrder = (u8)yymsp[0].minor.yy4; +} + break; + case 156: /* sortorder ::= ASC */ + case 158: /* sortorder ::= */ yytestcase(yyruleno==158); +{yygotominor.yy4 = SQLITE_SO_ASC;} + break; + case 157: /* sortorder ::= DESC */ +{yygotominor.yy4 = SQLITE_SO_DESC;} + break; + case 163: /* limit_opt ::= */ +{yygotominor.yy292.pLimit = 0; yygotominor.yy292.pOffset = 0;} + break; + case 164: /* limit_opt ::= LIMIT expr */ +{yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr; yygotominor.yy292.pOffset = 0;} + break; + case 165: /* limit_opt ::= LIMIT expr OFFSET expr */ +{yygotominor.yy292.pLimit = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pOffset = yymsp[0].minor.yy118.pExpr;} + break; + case 166: /* limit_opt ::= LIMIT expr COMMA expr */ +{yygotominor.yy292.pOffset = yymsp[-2].minor.yy118.pExpr; yygotominor.yy292.pLimit = yymsp[0].minor.yy118.pExpr;} + break; + case 167: /* cmd ::= DELETE FROM fullname indexed_opt where_opt */ +{ + sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy0); + sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy259,yymsp[0].minor.yy314); +} + break; + case 170: /* cmd ::= UPDATE orconf fullname indexed_opt SET setlist where_opt */ +{ + sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy259, &yymsp[-3].minor.yy0); + sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy322,"set list"); + sqlite3Update(pParse,yymsp[-4].minor.yy259,yymsp[-1].minor.yy322,yymsp[0].minor.yy314,yymsp[-5].minor.yy210); +} + break; + case 171: /* setlist ::= setlist COMMA nm EQ expr */ +{ + yygotominor.yy322 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy322, yymsp[0].minor.yy118.pExpr); + sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); +} + break; + case 172: /* setlist ::= nm EQ expr */ +{ + yygotominor.yy322 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy118.pExpr); + sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); +} + break; + case 173: /* cmd ::= insert_cmd INTO fullname inscollist_opt VALUES LP itemlist RP */ +{sqlite3Insert(pParse, yymsp[-5].minor.yy259, yymsp[-1].minor.yy322, 0, yymsp[-4].minor.yy384, yymsp[-7].minor.yy210);} + break; + case 174: /* cmd ::= insert_cmd INTO fullname inscollist_opt select */ +{sqlite3Insert(pParse, yymsp[-2].minor.yy259, 0, yymsp[0].minor.yy387, yymsp[-1].minor.yy384, yymsp[-4].minor.yy210);} + break; + case 175: /* cmd ::= insert_cmd INTO fullname inscollist_opt DEFAULT VALUES */ +{sqlite3Insert(pParse, yymsp[-3].minor.yy259, 0, 0, yymsp[-2].minor.yy384, yymsp[-5].minor.yy210);} + break; + case 176: /* insert_cmd ::= INSERT orconf */ +{yygotominor.yy210 = yymsp[0].minor.yy210;} + break; + case 177: /* insert_cmd ::= REPLACE */ +{yygotominor.yy210 = OE_Replace;} + break; + case 178: /* itemlist ::= itemlist COMMA expr */ + case 241: /* nexprlist ::= nexprlist COMMA expr */ yytestcase(yyruleno==241); +{yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy322,yymsp[0].minor.yy118.pExpr);} + break; + case 179: /* itemlist ::= expr */ + case 242: /* nexprlist ::= expr */ yytestcase(yyruleno==242); +{yygotominor.yy322 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy118.pExpr);} + break; + case 182: /* inscollist ::= inscollist COMMA nm */ +{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,yymsp[-2].minor.yy384,&yymsp[0].minor.yy0);} + break; + case 183: /* inscollist ::= nm */ +{yygotominor.yy384 = sqlite3IdListAppend(pParse->db,0,&yymsp[0].minor.yy0);} + break; + case 184: /* expr ::= term */ +{yygotominor.yy118 = yymsp[0].minor.yy118;} + break; + case 185: /* expr ::= LP expr RP */ +{yygotominor.yy118.pExpr = yymsp[-1].minor.yy118.pExpr; spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);} + break; + case 186: /* term ::= NULL */ + case 191: /* term ::= INTEGER|FLOAT|BLOB */ yytestcase(yyruleno==191); + case 192: /* term ::= STRING */ yytestcase(yyruleno==192); +{spanExpr(&yygotominor.yy118, pParse, yymsp[0].major, &yymsp[0].minor.yy0);} + break; + case 187: /* expr ::= id */ + case 188: /* expr ::= JOIN_KW */ yytestcase(yyruleno==188); +{spanExpr(&yygotominor.yy118, pParse, TK_ID, &yymsp[0].minor.yy0);} + break; + case 189: /* expr ::= nm DOT nm */ { Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); - spanSet(&yygotominor.yy342,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp2, 0); + spanSet(&yygotominor.yy118,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); } break; - case 189: /* expr ::= nm DOT nm DOT nm */ + case 190: /* expr ::= nm DOT nm DOT nm */ { Expr *temp1 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-4].minor.yy0); Expr *temp2 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[-2].minor.yy0); Expr *temp3 = sqlite3PExpr(pParse, TK_ID, 0, 0, &yymsp[0].minor.yy0); Expr *temp4 = sqlite3PExpr(pParse, TK_DOT, temp2, temp3, 0); - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); - spanSet(&yygotominor.yy342,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_DOT, temp1, temp4, 0); + spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); } break; - case 192: /* expr ::= REGISTER */ + case 193: /* expr ::= REGISTER */ { /* When doing a nested parse, one can include terms in an expression ** that look like this: #1 #2 ... These terms refer to registers ** in the virtual machine. #N is the N-th register. */ if( pParse->nested==0 ){ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &yymsp[0].minor.yy0); - yygotominor.yy342.pExpr = 0; - }else{ - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0); - if( yygotominor.yy342.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy342.pExpr->iTable); - } - spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); -} - break; - case 193: /* expr ::= VARIABLE */ -{ - spanExpr(&yygotominor.yy342, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); - sqlite3ExprAssignVarNumber(pParse, yygotominor.yy342.pExpr); - spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); -} - break; - case 194: /* expr ::= expr COLLATE ids */ -{ - yygotominor.yy342.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy342.pExpr, &yymsp[0].minor.yy0); - yygotominor.yy342.zStart = yymsp[-2].minor.yy342.zStart; - yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; -} - break; - case 195: /* expr ::= CAST LP expr AS typetoken RP */ -{ - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy342.pExpr, 0, &yymsp[-1].minor.yy0); - spanSet(&yygotominor.yy342,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); -} - break; - case 196: /* expr ::= ID LP distinct exprlist RP */ -{ - if( yymsp[-1].minor.yy442 && yymsp[-1].minor.yy442->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ + yygotominor.yy118.pExpr = 0; + }else{ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, &yymsp[0].minor.yy0); + if( yygotominor.yy118.pExpr ) sqlite3GetInt32(&yymsp[0].minor.yy0.z[1], &yygotominor.yy118.pExpr->iTable); + } + spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); +} + break; + case 194: /* expr ::= VARIABLE */ +{ + spanExpr(&yygotominor.yy118, pParse, TK_VARIABLE, &yymsp[0].minor.yy0); + sqlite3ExprAssignVarNumber(pParse, yygotominor.yy118.pExpr); + spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); +} + break; + case 195: /* expr ::= expr COLLATE ids */ +{ + yygotominor.yy118.pExpr = sqlite3ExprSetCollByToken(pParse, yymsp[-2].minor.yy118.pExpr, &yymsp[0].minor.yy0); + yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; +} + break; + case 196: /* expr ::= CAST LP expr AS typetoken RP */ +{ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CAST, yymsp[-3].minor.yy118.pExpr, 0, &yymsp[-1].minor.yy0); + spanSet(&yygotominor.yy118,&yymsp[-5].minor.yy0,&yymsp[0].minor.yy0); +} + break; + case 197: /* expr ::= ID LP distinct exprlist RP */ +{ + if( yymsp[-1].minor.yy322 && yymsp[-1].minor.yy322->nExpr>pParse->db->aLimit[SQLITE_LIMIT_FUNCTION_ARG] ){ sqlite3ErrorMsg(pParse, "too many arguments on function %T", &yymsp[-4].minor.yy0); } - yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy442, &yymsp[-4].minor.yy0); - spanSet(&yygotominor.yy342,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); - if( yymsp[-2].minor.yy392 && yygotominor.yy342.pExpr ){ - yygotominor.yy342.pExpr->flags |= EP_Distinct; - } -} - break; - case 197: /* expr ::= ID LP STAR RP */ -{ - yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); - spanSet(&yygotominor.yy342,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); -} - break; - case 198: /* term ::= CTIME_KW */ + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy322, &yymsp[-4].minor.yy0); + spanSet(&yygotominor.yy118,&yymsp[-4].minor.yy0,&yymsp[0].minor.yy0); + if( yymsp[-2].minor.yy4 && yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->flags |= EP_Distinct; + } +} + break; + case 198: /* expr ::= ID LP STAR RP */ +{ + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0); + spanSet(&yygotominor.yy118,&yymsp[-3].minor.yy0,&yymsp[0].minor.yy0); +} + break; + case 199: /* term ::= CTIME_KW */ { /* The CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP values are ** treated as functions that return constants */ - yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); - if( yygotominor.yy342.pExpr ){ - yygotominor.yy342.pExpr->op = TK_CONST_FUNC; - } - spanSet(&yygotominor.yy342, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); -} - break; - case 199: /* expr ::= expr AND expr */ - case 200: /* expr ::= expr OR expr */ yytestcase(yyruleno==200); - case 201: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==201); - case 202: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==202); - case 203: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==203); - case 204: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==204); - case 205: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==205); - case 206: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==206); -{spanBinaryExpr(&yygotominor.yy342,pParse,yymsp[-1].major,&yymsp[-2].minor.yy342,&yymsp[0].minor.yy342);} - break; - case 207: /* likeop ::= LIKE_KW */ - case 209: /* likeop ::= MATCH */ yytestcase(yyruleno==209); -{yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.bNot = 0;} - break; - case 208: /* likeop ::= NOT LIKE_KW */ - case 210: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==210); -{yygotominor.yy318.eOperator = yymsp[0].minor.yy0; yygotominor.yy318.bNot = 1;} - break; - case 211: /* expr ::= expr likeop expr */ -{ - ExprList *pList; - pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy342.pExpr); - pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy342.pExpr); - yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy318.eOperator); - if( yymsp[-1].minor.yy318.bNot ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); - yygotominor.yy342.zStart = yymsp[-2].minor.yy342.zStart; - yygotominor.yy342.zEnd = yymsp[0].minor.yy342.zEnd; - if( yygotominor.yy342.pExpr ) yygotominor.yy342.pExpr->flags |= EP_InfixFunc; -} - break; - case 212: /* expr ::= expr likeop expr ESCAPE expr */ -{ - ExprList *pList; - pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy342.pExpr); - pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy342.pExpr); - pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy342.pExpr); - yygotominor.yy342.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy318.eOperator); - if( yymsp[-3].minor.yy318.bNot ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); - yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; - yygotominor.yy342.zEnd = yymsp[0].minor.yy342.zEnd; - if( yygotominor.yy342.pExpr ) yygotominor.yy342.pExpr->flags |= EP_InfixFunc; -} - break; - case 213: /* expr ::= expr ISNULL|NOTNULL */ -{spanUnaryPostfix(&yygotominor.yy342,pParse,yymsp[0].major,&yymsp[-1].minor.yy342,&yymsp[0].minor.yy0);} - break; - case 214: /* expr ::= expr NOT NULL */ -{spanUnaryPostfix(&yygotominor.yy342,pParse,TK_NOTNULL,&yymsp[-2].minor.yy342,&yymsp[0].minor.yy0);} - break; - case 215: /* expr ::= expr IS expr */ -{ - spanBinaryExpr(&yygotominor.yy342,pParse,TK_IS,&yymsp[-2].minor.yy342,&yymsp[0].minor.yy342); - binaryToUnaryIfNull(pParse, yymsp[0].minor.yy342.pExpr, yygotominor.yy342.pExpr, TK_ISNULL); -} - break; - case 216: /* expr ::= expr IS NOT expr */ -{ - spanBinaryExpr(&yygotominor.yy342,pParse,TK_ISNOT,&yymsp[-3].minor.yy342,&yymsp[0].minor.yy342); - binaryToUnaryIfNull(pParse, yymsp[0].minor.yy342.pExpr, yygotominor.yy342.pExpr, TK_NOTNULL); -} - break; - case 217: /* expr ::= NOT expr */ - case 218: /* expr ::= BITNOT expr */ yytestcase(yyruleno==218); -{spanUnaryPrefix(&yygotominor.yy342,pParse,yymsp[-1].major,&yymsp[0].minor.yy342,&yymsp[-1].minor.yy0);} - break; - case 219: /* expr ::= MINUS expr */ -{spanUnaryPrefix(&yygotominor.yy342,pParse,TK_UMINUS,&yymsp[0].minor.yy342,&yymsp[-1].minor.yy0);} - break; - case 220: /* expr ::= PLUS expr */ -{spanUnaryPrefix(&yygotominor.yy342,pParse,TK_UPLUS,&yymsp[0].minor.yy342,&yymsp[-1].minor.yy0);} - break; - case 223: /* expr ::= expr between_op expr AND expr */ -{ - ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy342.pExpr); - pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy342.pExpr); - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy342.pExpr, 0, 0); - if( yygotominor.yy342.pExpr ){ - yygotominor.yy342.pExpr->x.pList = pList; + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, 0,&yymsp[0].minor.yy0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->op = TK_CONST_FUNC; + } + spanSet(&yygotominor.yy118, &yymsp[0].minor.yy0, &yymsp[0].minor.yy0); +} + break; + case 200: /* expr ::= expr AND expr */ + case 201: /* expr ::= expr OR expr */ yytestcase(yyruleno==201); + case 202: /* expr ::= expr LT|GT|GE|LE expr */ yytestcase(yyruleno==202); + case 203: /* expr ::= expr EQ|NE expr */ yytestcase(yyruleno==203); + case 204: /* expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */ yytestcase(yyruleno==204); + case 205: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==205); + case 206: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==206); + case 207: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==207); +{spanBinaryExpr(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118);} + break; + case 208: /* likeop ::= LIKE_KW */ + case 210: /* likeop ::= MATCH */ yytestcase(yyruleno==210); +{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 0;} + break; + case 209: /* likeop ::= NOT LIKE_KW */ + case 211: /* likeop ::= NOT MATCH */ yytestcase(yyruleno==211); +{yygotominor.yy342.eOperator = yymsp[0].minor.yy0; yygotominor.yy342.not = 1;} + break; + case 212: /* expr ::= expr likeop expr */ +{ + ExprList *pList; + pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy118.pExpr); + pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy118.pExpr); + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy342.eOperator); + if( yymsp[-1].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-2].minor.yy118.zStart; + yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; + if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; +} + break; + case 213: /* expr ::= expr likeop expr ESCAPE expr */ +{ + ExprList *pList; + pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); + pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy118.pExpr); + pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); + yygotominor.yy118.pExpr = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy342.eOperator); + if( yymsp[-3].minor.yy342.not ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; + yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; + if( yygotominor.yy118.pExpr ) yygotominor.yy118.pExpr->flags |= EP_InfixFunc; +} + break; + case 214: /* expr ::= expr ISNULL|NOTNULL */ +{spanUnaryPostfix(&yygotominor.yy118,pParse,yymsp[0].major,&yymsp[-1].minor.yy118,&yymsp[0].minor.yy0);} + break; + case 215: /* expr ::= expr NOT NULL */ +{spanUnaryPostfix(&yygotominor.yy118,pParse,TK_NOTNULL,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy0);} + break; + case 216: /* expr ::= expr IS expr */ +{ + spanBinaryExpr(&yygotominor.yy118,pParse,TK_IS,&yymsp[-2].minor.yy118,&yymsp[0].minor.yy118); + binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_ISNULL); +} + break; + case 217: /* expr ::= expr IS NOT expr */ +{ + spanBinaryExpr(&yygotominor.yy118,pParse,TK_ISNOT,&yymsp[-3].minor.yy118,&yymsp[0].minor.yy118); + binaryToUnaryIfNull(pParse, yymsp[0].minor.yy118.pExpr, yygotominor.yy118.pExpr, TK_NOTNULL); +} + break; + case 218: /* expr ::= NOT expr */ + case 219: /* expr ::= BITNOT expr */ yytestcase(yyruleno==219); +{spanUnaryPrefix(&yygotominor.yy118,pParse,yymsp[-1].major,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} + break; + case 220: /* expr ::= MINUS expr */ +{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UMINUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} + break; + case 221: /* expr ::= PLUS expr */ +{spanUnaryPrefix(&yygotominor.yy118,pParse,TK_UPLUS,&yymsp[0].minor.yy118,&yymsp[-1].minor.yy0);} + break; + case 224: /* expr ::= expr between_op expr AND expr */ +{ + ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); + pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy118.pExpr); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy118.pExpr, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pList = pList; }else{ sqlite3ExprListDelete(pParse->db, pList); } - if( yymsp[-3].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); - yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; - yygotominor.yy342.zEnd = yymsp[0].minor.yy342.zEnd; -} - break; - case 226: /* expr ::= expr in_op LP exprlist RP */ -{ - if( yymsp[-1].minor.yy442==0 ){ + if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; + yygotominor.yy118.zEnd = yymsp[0].minor.yy118.zEnd; +} + break; + case 227: /* expr ::= expr in_op LP exprlist RP */ +{ + if( yymsp[-1].minor.yy322==0 ){ /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** ** simplify to constants 0 (false) and 1 (true), respectively, ** regardless of the value of expr1. */ - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy392]); - sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy342.pExpr); - }else{ - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy342.pExpr, 0, 0); - if( yygotominor.yy342.pExpr ){ - yygotominor.yy342.pExpr->x.pList = yymsp[-1].minor.yy442; - sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); - }else{ - sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy442); - } - if( yymsp[-3].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); - } - yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; - yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; - } - break; - case 227: /* expr ::= LP select RP */ -{ - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); - if( yygotominor.yy342.pExpr ){ - yygotominor.yy342.pExpr->x.pSelect = yymsp[-1].minor.yy159; - ExprSetProperty(yygotominor.yy342.pExpr, EP_xIsSelect); - sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); - }else{ - sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159); - } - yygotominor.yy342.zStart = yymsp[-2].minor.yy0.z; - yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; - } - break; - case 228: /* expr ::= expr in_op LP select RP */ -{ - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy342.pExpr, 0, 0); - if( yygotominor.yy342.pExpr ){ - yygotominor.yy342.pExpr->x.pSelect = yymsp[-1].minor.yy159; - ExprSetProperty(yygotominor.yy342.pExpr, EP_xIsSelect); - sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); - }else{ - sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159); - } - if( yymsp[-3].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); - yygotominor.yy342.zStart = yymsp[-4].minor.yy342.zStart; - yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; - } - break; - case 229: /* expr ::= expr in_op nm dbnm */ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &sqlite3IntTokens[yymsp[-3].minor.yy4]); + sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy118.pExpr); + }else{ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pList = yymsp[-1].minor.yy322; + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); + }else{ + sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy322); + } + if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + } + yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + } + break; + case 228: /* expr ::= LP select RP */ +{ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_SELECT, 0, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; + ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); + }else{ + sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); + } + yygotominor.yy118.zStart = yymsp[-2].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + } + break; + case 229: /* expr ::= expr in_op LP select RP */ +{ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy118.pExpr, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pSelect = yymsp[-1].minor.yy387; + ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); + }else{ + sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); + } + if( yymsp[-3].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-4].minor.yy118.zStart; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + } + break; + case 230: /* expr ::= expr in_op nm dbnm */ { SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0); - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy342.pExpr, 0, 0); - if( yygotominor.yy342.pExpr ){ - yygotominor.yy342.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); - ExprSetProperty(yygotominor.yy342.pExpr, EP_xIsSelect); - sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_IN, yymsp[-3].minor.yy118.pExpr, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0,0); + ExprSetProperty(yygotominor.yy118.pExpr, EP_xIsSelect); + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); }else{ sqlite3SrcListDelete(pParse->db, pSrc); } - if( yymsp[-2].minor.yy392 ) yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy342.pExpr, 0, 0); - yygotominor.yy342.zStart = yymsp[-3].minor.yy342.zStart; - yygotominor.yy342.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]; - } - break; - case 230: /* expr ::= EXISTS LP select RP */ -{ - Expr *p = yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); + if( yymsp[-2].minor.yy4 ) yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_NOT, yygotominor.yy118.pExpr, 0, 0); + yygotominor.yy118.zStart = yymsp[-3].minor.yy118.zStart; + yygotominor.yy118.zEnd = yymsp[0].minor.yy0.z ? &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n] : &yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]; + } + break; + case 231: /* expr ::= EXISTS LP select RP */ +{ + Expr *p = yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_EXISTS, 0, 0, 0); if( p ){ - p->x.pSelect = yymsp[-1].minor.yy159; + p->x.pSelect = yymsp[-1].minor.yy387; ExprSetProperty(p, EP_xIsSelect); sqlite3ExprSetHeight(pParse, p); }else{ - sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy159); - } - yygotominor.yy342.zStart = yymsp[-3].minor.yy0.z; - yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; - } - break; - case 231: /* expr ::= CASE case_operand case_exprlist case_else END */ -{ - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy122, yymsp[-1].minor.yy122, 0); - if( yygotominor.yy342.pExpr ){ - yygotominor.yy342.pExpr->x.pList = yymsp[-2].minor.yy442; - sqlite3ExprSetHeight(pParse, yygotominor.yy342.pExpr); - }else{ - sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy442); - } - yygotominor.yy342.zStart = yymsp[-4].minor.yy0.z; - yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; -} - break; - case 232: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ -{ - yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, yymsp[-2].minor.yy342.pExpr); - yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].minor.yy342.pExpr); -} - break; - case 233: /* case_exprlist ::= WHEN expr THEN expr */ -{ - yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy342.pExpr); - yygotominor.yy442 = sqlite3ExprListAppend(pParse,yygotominor.yy442, yymsp[0].minor.yy342.pExpr); -} - break; - case 240: /* nexprlist ::= nexprlist COMMA expr */ -{yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy442,yymsp[0].minor.yy342.pExpr);} - break; - case 241: /* nexprlist ::= expr */ -{yygotominor.yy442 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy342.pExpr);} - break; - case 242: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ + sqlite3SelectDelete(pParse->db, yymsp[-1].minor.yy387); + } + yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; + } + break; + case 232: /* expr ::= CASE case_operand case_exprlist case_else END */ +{ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy314, yymsp[-1].minor.yy314, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->x.pList = yymsp[-2].minor.yy322; + sqlite3ExprSetHeight(pParse, yygotominor.yy118.pExpr); + }else{ + sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy322); + } + yygotominor.yy118.zStart = yymsp[-4].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; +} + break; + case 233: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */ +{ + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, yymsp[-2].minor.yy118.pExpr); + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); +} + break; + case 234: /* case_exprlist ::= WHEN expr THEN expr */ +{ + yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy118.pExpr); + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yygotominor.yy322, yymsp[0].minor.yy118.pExpr); +} + break; + case 243: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP idxlist RP */ { sqlite3CreateIndex(pParse, &yymsp[-6].minor.yy0, &yymsp[-5].minor.yy0, - sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy442, yymsp[-9].minor.yy392, - &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy392); + sqlite3SrcListAppend(pParse->db,0,&yymsp[-3].minor.yy0,0), yymsp[-1].minor.yy322, yymsp[-9].minor.yy4, + &yymsp[-10].minor.yy0, &yymsp[0].minor.yy0, SQLITE_SO_ASC, yymsp[-7].minor.yy4); } break; - case 243: /* uniqueflag ::= UNIQUE */ - case 296: /* raisetype ::= ABORT */ yytestcase(yyruleno==296); -{yygotominor.yy392 = OE_Abort;} - break; - case 244: /* uniqueflag ::= */ -{yygotominor.yy392 = OE_None;} - break; - case 247: /* idxlist ::= idxlist COMMA nm collate sortorder */ + case 244: /* uniqueflag ::= UNIQUE */ + case 298: /* raisetype ::= ABORT */ yytestcase(yyruleno==298); +{yygotominor.yy4 = OE_Abort;} + break; + case 245: /* uniqueflag ::= */ +{yygotominor.yy4 = OE_None;} + break; + case 248: /* idxlist ::= idxlist COMMA nm collate sortorder */ { Expr *p = 0; if( yymsp[-1].minor.yy0.n>0 ){ p = sqlite3Expr(pParse->db, TK_COLUMN, 0); sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); } - yygotominor.yy442 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy442, p); - sqlite3ExprListSetName(pParse,yygotominor.yy442,&yymsp[-2].minor.yy0,1); - sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index"); - if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392; + yygotominor.yy322 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy322, p); + sqlite3ExprListSetName(pParse,yygotominor.yy322,&yymsp[-2].minor.yy0,1); + sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); + if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; } break; - case 248: /* idxlist ::= nm collate sortorder */ + case 249: /* idxlist ::= nm collate sortorder */ { Expr *p = 0; if( yymsp[-1].minor.yy0.n>0 ){ p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); sqlite3ExprSetCollByToken(pParse, p, &yymsp[-1].minor.yy0); } - yygotominor.yy442 = sqlite3ExprListAppend(pParse,0, p); - sqlite3ExprListSetName(pParse, yygotominor.yy442, &yymsp[-2].minor.yy0, 1); - sqlite3ExprListCheckLength(pParse, yygotominor.yy442, "index"); - if( yygotominor.yy442 ) yygotominor.yy442->a[yygotominor.yy442->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy392; + yygotominor.yy322 = sqlite3ExprListAppend(pParse,0, p); + sqlite3ExprListSetName(pParse, yygotominor.yy322, &yymsp[-2].minor.yy0, 1); + sqlite3ExprListCheckLength(pParse, yygotominor.yy322, "index"); + if( yygotominor.yy322 ) yygotominor.yy322->a[yygotominor.yy322->nExpr-1].sortOrder = (u8)yymsp[0].minor.yy4; } break; - case 249: /* collate ::= */ + case 250: /* collate ::= */ {yygotominor.yy0.z = 0; yygotominor.yy0.n = 0;} break; - case 251: /* cmd ::= DROP INDEX ifexists fullname */ -{sqlite3DropIndex(pParse, yymsp[0].minor.yy347, yymsp[-1].minor.yy392);} + case 252: /* cmd ::= DROP INDEX ifexists fullname */ +{sqlite3DropIndex(pParse, yymsp[0].minor.yy259, yymsp[-1].minor.yy4);} break; - case 252: /* cmd ::= VACUUM */ - case 253: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==253); + case 253: /* cmd ::= VACUUM */ + case 254: /* cmd ::= VACUUM nm */ yytestcase(yyruleno==254); {sqlite3Vacuum(pParse);} break; - case 254: /* cmd ::= PRAGMA nm dbnm */ + case 255: /* cmd ::= PRAGMA nm dbnm */ {sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);} break; - case 255: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ + case 256: /* cmd ::= PRAGMA nm dbnm EQ nmnum */ {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);} break; - case 256: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ + case 257: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */ {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);} break; - case 257: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ + case 258: /* cmd ::= PRAGMA nm dbnm EQ minus_num */ {sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);} break; - case 258: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ + case 259: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */ {sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);} break; - case 268: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ + case 270: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */ { Token all; all.z = yymsp[-3].minor.yy0.z; all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n; - sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy327, &all); + sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy203, &all); } break; - case 269: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ + case 271: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ { - sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy392, yymsp[-4].minor.yy410.a, yymsp[-4].minor.yy410.b, yymsp[-2].minor.yy347, yymsp[0].minor.yy122, yymsp[-10].minor.yy392, yymsp[-8].minor.yy392); + sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy4, yymsp[-4].minor.yy90.a, yymsp[-4].minor.yy90.b, yymsp[-2].minor.yy259, yymsp[0].minor.yy314, yymsp[-10].minor.yy4, yymsp[-8].minor.yy4); yygotominor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); } break; - case 270: /* trigger_time ::= BEFORE */ - case 273: /* trigger_time ::= */ yytestcase(yyruleno==273); -{ yygotominor.yy392 = TK_BEFORE; } - break; - case 271: /* trigger_time ::= AFTER */ -{ yygotominor.yy392 = TK_AFTER; } - break; - case 272: /* trigger_time ::= INSTEAD OF */ -{ yygotominor.yy392 = TK_INSTEAD;} - break; - case 274: /* trigger_event ::= DELETE|INSERT */ - case 275: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==275); -{yygotominor.yy410.a = yymsp[0].major; yygotominor.yy410.b = 0;} - break; - case 276: /* trigger_event ::= UPDATE OF inscollist */ -{yygotominor.yy410.a = TK_UPDATE; yygotominor.yy410.b = yymsp[0].minor.yy180;} - break; - case 279: /* when_clause ::= */ - case 301: /* key_opt ::= */ yytestcase(yyruleno==301); -{ yygotominor.yy122 = 0; } - break; - case 280: /* when_clause ::= WHEN expr */ - case 302: /* key_opt ::= KEY expr */ yytestcase(yyruleno==302); -{ yygotominor.yy122 = yymsp[0].minor.yy342.pExpr; } - break; - case 281: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ -{ - assert( yymsp[-2].minor.yy327!=0 ); - yymsp[-2].minor.yy327->pLast->pNext = yymsp[-1].minor.yy327; - yymsp[-2].minor.yy327->pLast = yymsp[-1].minor.yy327; - yygotominor.yy327 = yymsp[-2].minor.yy327; -} - break; - case 282: /* trigger_cmd_list ::= trigger_cmd SEMI */ -{ - assert( yymsp[-1].minor.yy327!=0 ); - yymsp[-1].minor.yy327->pLast = yymsp[-1].minor.yy327; - yygotominor.yy327 = yymsp[-1].minor.yy327; -} - break; - case 284: /* trnm ::= nm DOT nm */ + case 272: /* trigger_time ::= BEFORE */ + case 275: /* trigger_time ::= */ yytestcase(yyruleno==275); +{ yygotominor.yy4 = TK_BEFORE; } + break; + case 273: /* trigger_time ::= AFTER */ +{ yygotominor.yy4 = TK_AFTER; } + break; + case 274: /* trigger_time ::= INSTEAD OF */ +{ yygotominor.yy4 = TK_INSTEAD;} + break; + case 276: /* trigger_event ::= DELETE|INSERT */ + case 277: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==277); +{yygotominor.yy90.a = yymsp[0].major; yygotominor.yy90.b = 0;} + break; + case 278: /* trigger_event ::= UPDATE OF inscollist */ +{yygotominor.yy90.a = TK_UPDATE; yygotominor.yy90.b = yymsp[0].minor.yy384;} + break; + case 281: /* when_clause ::= */ + case 303: /* key_opt ::= */ yytestcase(yyruleno==303); +{ yygotominor.yy314 = 0; } + break; + case 282: /* when_clause ::= WHEN expr */ + case 304: /* key_opt ::= KEY expr */ yytestcase(yyruleno==304); +{ yygotominor.yy314 = yymsp[0].minor.yy118.pExpr; } + break; + case 283: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */ +{ + assert( yymsp[-2].minor.yy203!=0 ); + yymsp[-2].minor.yy203->pLast->pNext = yymsp[-1].minor.yy203; + yymsp[-2].minor.yy203->pLast = yymsp[-1].minor.yy203; + yygotominor.yy203 = yymsp[-2].minor.yy203; +} + break; + case 284: /* trigger_cmd_list ::= trigger_cmd SEMI */ +{ + assert( yymsp[-1].minor.yy203!=0 ); + yymsp[-1].minor.yy203->pLast = yymsp[-1].minor.yy203; + yygotominor.yy203 = yymsp[-1].minor.yy203; +} + break; + case 286: /* trnm ::= nm DOT nm */ { yygotominor.yy0 = yymsp[0].minor.yy0; sqlite3ErrorMsg(pParse, "qualified table names are not allowed on INSERT, UPDATE, and DELETE " "statements within triggers"); } break; - case 286: /* tridxby ::= INDEXED BY nm */ + case 288: /* tridxby ::= INDEXED BY nm */ { sqlite3ErrorMsg(pParse, "the INDEXED BY clause is not allowed on UPDATE or DELETE statements " "within triggers"); } break; - case 287: /* tridxby ::= NOT INDEXED */ + case 289: /* tridxby ::= NOT INDEXED */ { sqlite3ErrorMsg(pParse, "the NOT INDEXED clause is not allowed on UPDATE or DELETE statements " "within triggers"); } break; - case 288: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */ -{ yygotominor.yy327 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy442, yymsp[0].minor.yy122, yymsp[-5].minor.yy258); } - break; - case 289: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt valuelist */ -{yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy180, yymsp[0].minor.yy487.pList, yymsp[0].minor.yy487.pSelect, yymsp[-4].minor.yy258);} - break; - case 290: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ -{yygotominor.yy327 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy180, 0, yymsp[0].minor.yy159, yymsp[-4].minor.yy258);} - break; - case 291: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ -{yygotominor.yy327 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy122);} - break; - case 292: /* trigger_cmd ::= select */ -{yygotominor.yy327 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy159); } - break; - case 293: /* expr ::= RAISE LP IGNORE RP */ -{ - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); - if( yygotominor.yy342.pExpr ){ - yygotominor.yy342.pExpr->affinity = OE_Ignore; - } - yygotominor.yy342.zStart = yymsp[-3].minor.yy0.z; - yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; -} - break; - case 294: /* expr ::= RAISE LP raisetype COMMA nm RP */ -{ - yygotominor.yy342.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); - if( yygotominor.yy342.pExpr ) { - yygotominor.yy342.pExpr->affinity = (char)yymsp[-3].minor.yy392; - } - yygotominor.yy342.zStart = yymsp[-5].minor.yy0.z; - yygotominor.yy342.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; -} - break; - case 295: /* raisetype ::= ROLLBACK */ -{yygotominor.yy392 = OE_Rollback;} - break; - case 297: /* raisetype ::= FAIL */ -{yygotominor.yy392 = OE_Fail;} - break; - case 298: /* cmd ::= DROP TRIGGER ifexists fullname */ -{ - sqlite3DropTrigger(pParse,yymsp[0].minor.yy347,yymsp[-1].minor.yy392); -} - break; - case 299: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ -{ - sqlite3Attach(pParse, yymsp[-3].minor.yy342.pExpr, yymsp[-1].minor.yy342.pExpr, yymsp[0].minor.yy122); -} - break; - case 300: /* cmd ::= DETACH database_kw_opt expr */ -{ - sqlite3Detach(pParse, yymsp[0].minor.yy342.pExpr); -} - break; - case 305: /* cmd ::= REINDEX */ + case 290: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt */ +{ yygotominor.yy203 = sqlite3TriggerUpdateStep(pParse->db, &yymsp[-4].minor.yy0, yymsp[-1].minor.yy322, yymsp[0].minor.yy314, yymsp[-5].minor.yy210); } + break; + case 291: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt VALUES LP itemlist RP */ +{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy384, yymsp[-1].minor.yy322, 0, yymsp[-7].minor.yy210);} + break; + case 292: /* trigger_cmd ::= insert_cmd INTO trnm inscollist_opt select */ +{yygotominor.yy203 = sqlite3TriggerInsertStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy384, 0, yymsp[0].minor.yy387, yymsp[-4].minor.yy210);} + break; + case 293: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt */ +{yygotominor.yy203 = sqlite3TriggerDeleteStep(pParse->db, &yymsp[-2].minor.yy0, yymsp[0].minor.yy314);} + break; + case 294: /* trigger_cmd ::= select */ +{yygotominor.yy203 = sqlite3TriggerSelectStep(pParse->db, yymsp[0].minor.yy387); } + break; + case 295: /* expr ::= RAISE LP IGNORE RP */ +{ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, 0); + if( yygotominor.yy118.pExpr ){ + yygotominor.yy118.pExpr->affinity = OE_Ignore; + } + yygotominor.yy118.zStart = yymsp[-3].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; +} + break; + case 296: /* expr ::= RAISE LP raisetype COMMA nm RP */ +{ + yygotominor.yy118.pExpr = sqlite3PExpr(pParse, TK_RAISE, 0, 0, &yymsp[-1].minor.yy0); + if( yygotominor.yy118.pExpr ) { + yygotominor.yy118.pExpr->affinity = (char)yymsp[-3].minor.yy4; + } + yygotominor.yy118.zStart = yymsp[-5].minor.yy0.z; + yygotominor.yy118.zEnd = &yymsp[0].minor.yy0.z[yymsp[0].minor.yy0.n]; +} + break; + case 297: /* raisetype ::= ROLLBACK */ +{yygotominor.yy4 = OE_Rollback;} + break; + case 299: /* raisetype ::= FAIL */ +{yygotominor.yy4 = OE_Fail;} + break; + case 300: /* cmd ::= DROP TRIGGER ifexists fullname */ +{ + sqlite3DropTrigger(pParse,yymsp[0].minor.yy259,yymsp[-1].minor.yy4); +} + break; + case 301: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */ +{ + sqlite3Attach(pParse, yymsp[-3].minor.yy118.pExpr, yymsp[-1].minor.yy118.pExpr, yymsp[0].minor.yy314); +} + break; + case 302: /* cmd ::= DETACH database_kw_opt expr */ +{ + sqlite3Detach(pParse, yymsp[0].minor.yy118.pExpr); +} + break; + case 307: /* cmd ::= REINDEX */ {sqlite3Reindex(pParse, 0, 0);} break; - case 306: /* cmd ::= REINDEX nm dbnm */ + case 308: /* cmd ::= REINDEX nm dbnm */ {sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} break; - case 307: /* cmd ::= ANALYZE */ + case 309: /* cmd ::= ANALYZE */ {sqlite3Analyze(pParse, 0, 0);} break; - case 308: /* cmd ::= ANALYZE nm dbnm */ + case 310: /* cmd ::= ANALYZE nm dbnm */ {sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);} break; - case 309: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ + case 311: /* cmd ::= ALTER TABLE fullname RENAME TO nm */ { - sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy347,&yymsp[0].minor.yy0); + sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy259,&yymsp[0].minor.yy0); } break; - case 310: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ + case 312: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt column */ { sqlite3AlterFinishAddColumn(pParse, &yymsp[0].minor.yy0); } break; - case 311: /* add_column_fullname ::= fullname */ + case 313: /* add_column_fullname ::= fullname */ { pParse->db->lookaside.bEnabled = 0; - sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy347); + sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy259); } break; - case 314: /* cmd ::= create_vtab */ + case 316: /* cmd ::= create_vtab */ {sqlite3VtabFinishParse(pParse,0);} break; - case 315: /* cmd ::= create_vtab LP vtabarglist RP */ + case 317: /* cmd ::= create_vtab LP vtabarglist RP */ {sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);} break; - case 316: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */ + case 318: /* create_vtab ::= createkw VIRTUAL TABLE nm dbnm USING nm */ { - sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy392); + sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); } break; - case 319: /* vtabarg ::= */ + case 321: /* vtabarg ::= */ {sqlite3VtabArgInit(pParse);} break; - case 321: /* vtabargtoken ::= ANY */ - case 322: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==322); - case 323: /* lp ::= LP */ yytestcase(yyruleno==323); + case 323: /* vtabargtoken ::= ANY */ + case 324: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==324); + case 325: /* lp ::= LP */ yytestcase(yyruleno==325); {sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);} break; default: /* (0) input ::= cmdlist */ yytestcase(yyruleno==0); /* (1) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==1); @@ -111421,29 +110732,34 @@ /* (34) columnlist ::= columnlist COMMA column */ yytestcase(yyruleno==34); /* (35) columnlist ::= column */ yytestcase(yyruleno==35); /* (44) type ::= */ yytestcase(yyruleno==44); /* (51) signed ::= plus_num */ yytestcase(yyruleno==51); /* (52) signed ::= minus_num */ yytestcase(yyruleno==52); - /* (53) carglist ::= carglist ccons */ yytestcase(yyruleno==53); + /* (53) carglist ::= carglist carg */ yytestcase(yyruleno==53); /* (54) carglist ::= */ yytestcase(yyruleno==54); - /* (61) ccons ::= NULL onconf */ yytestcase(yyruleno==61); - /* (89) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==89); - /* (90) conslist ::= tcons */ yytestcase(yyruleno==90); - /* (92) tconscomma ::= */ yytestcase(yyruleno==92); - /* (277) foreach_clause ::= */ yytestcase(yyruleno==277); - /* (278) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==278); - /* (285) tridxby ::= */ yytestcase(yyruleno==285); - /* (303) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==303); - /* (304) database_kw_opt ::= */ yytestcase(yyruleno==304); - /* (312) kwcolumn_opt ::= */ yytestcase(yyruleno==312); - /* (313) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==313); - /* (317) vtabarglist ::= vtabarg */ yytestcase(yyruleno==317); - /* (318) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==318); - /* (320) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==320); - /* (324) anylist ::= */ yytestcase(yyruleno==324); - /* (325) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==325); - /* (326) anylist ::= anylist ANY */ yytestcase(yyruleno==326); + /* (55) carg ::= CONSTRAINT nm ccons */ yytestcase(yyruleno==55); + /* (56) carg ::= ccons */ yytestcase(yyruleno==56); + /* (62) ccons ::= NULL onconf */ yytestcase(yyruleno==62); + /* (90) conslist ::= conslist COMMA tcons */ yytestcase(yyruleno==90); + /* (91) conslist ::= conslist tcons */ yytestcase(yyruleno==91); + /* (92) conslist ::= tcons */ yytestcase(yyruleno==92); + /* (93) tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==93); + /* (268) plus_opt ::= PLUS */ yytestcase(yyruleno==268); + /* (269) plus_opt ::= */ yytestcase(yyruleno==269); + /* (279) foreach_clause ::= */ yytestcase(yyruleno==279); + /* (280) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==280); + /* (287) tridxby ::= */ yytestcase(yyruleno==287); + /* (305) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==305); + /* (306) database_kw_opt ::= */ yytestcase(yyruleno==306); + /* (314) kwcolumn_opt ::= */ yytestcase(yyruleno==314); + /* (315) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==315); + /* (319) vtabarglist ::= vtabarg */ yytestcase(yyruleno==319); + /* (320) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==320); + /* (322) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==322); + /* (326) anylist ::= */ yytestcase(yyruleno==326); + /* (327) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==327); + /* (328) anylist ::= anylist ANY */ yytestcase(yyruleno==328); break; }; yygoto = yyRuleInfo[yyruleno].lhs; yysize = yyRuleInfo[yyruleno].nrhs; yypParser->yyidx -= yysize; @@ -113724,27 +113040,23 @@ sqlite3_free(db); return SQLITE_OK; } /* -** Rollback all database files. If tripCode is not SQLITE_OK, then -** any open cursors are invalidated ("tripped" - as in "tripping a circuit -** breaker") and made to return tripCode if there are any further -** attempts to use that cursor. +** Rollback all database files. */ -SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db, int tripCode){ +SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db){ int i; int inTrans = 0; assert( sqlite3_mutex_held(db->mutex) ); sqlite3BeginBenignMalloc(); for(i=0; inDb; i++){ - Btree *p = db->aDb[i].pBt; - if( p ){ - if( sqlite3BtreeIsInTrans(p) ){ + if( db->aDb[i].pBt ){ + if( sqlite3BtreeIsInTrans(db->aDb[i].pBt) ){ inTrans = 1; } - sqlite3BtreeRollback(p, tripCode); + sqlite3BtreeRollback(db->aDb[i].pBt); db->aDb[i].inTrans = 0; } } sqlite3VtabRollback(db); sqlite3EndBenignMalloc(); @@ -113795,25 +113107,16 @@ /* SQLITE_AUTH */ "authorization denied", /* SQLITE_FORMAT */ "auxiliary database format error", /* SQLITE_RANGE */ "bind or column index out of range", /* SQLITE_NOTADB */ "file is encrypted or is not a database", }; - const char *zErr = "unknown error"; - switch( rc ){ - case SQLITE_ABORT_ROLLBACK: { - zErr = "abort due to ROLLBACK"; - break; - } - default: { - rc &= 0xff; - if( ALWAYS(rc>=0) && rc=0) && rc<(int)(sizeof(aMsg)/sizeof(aMsg[0])) && aMsg[rc]!=0 ){ + return aMsg[rc]; + }else{ + return "unknown error"; + } } /* ** This routine implements a busy callback that sleeps and tries ** again until a timeout value is reached. The timeout value is @@ -114187,12 +113490,13 @@ sqlite3_mutex_leave(db->mutex); return pOld; } #endif /* SQLITE_OMIT_TRACE */ -/* -** Register a function to be invoked when a transaction commits. +/*** EXPERIMENTAL *** +** +** Register a function to be invoked when a transaction comments. ** If the invoked function returns non-zero, then the commit becomes a ** rollback. */ SQLITE_API void *sqlite3_commit_hook( sqlite3 *db, /* Attach the hook to this database */ @@ -115579,31 +114883,39 @@ /* ** Invoke the xFileControl method on a particular database. */ SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ int rc = SQLITE_ERROR; - Btree *pBtree; - + int iDb; sqlite3_mutex_enter(db->mutex); - pBtree = sqlite3DbNameToBtree(db, zDbName); - if( pBtree ){ - Pager *pPager; - sqlite3_file *fd; - sqlite3BtreeEnter(pBtree); - pPager = sqlite3BtreePager(pBtree); - assert( pPager!=0 ); - fd = sqlite3PagerFile(pPager); - assert( fd!=0 ); - if( op==SQLITE_FCNTL_FILE_POINTER ){ - *(sqlite3_file**)pArg = fd; - rc = SQLITE_OK; - }else if( fd->pMethods ){ - rc = sqlite3OsFileControl(fd, op, pArg); - }else{ - rc = SQLITE_NOTFOUND; - } - sqlite3BtreeLeave(pBtree); + if( zDbName==0 ){ + iDb = 0; + }else{ + for(iDb=0; iDbnDb; iDb++){ + if( strcmp(db->aDb[iDb].zName, zDbName)==0 ) break; + } + } + if( iDbnDb ){ + Btree *pBtree = db->aDb[iDb].pBt; + if( pBtree ){ + Pager *pPager; + sqlite3_file *fd; + sqlite3BtreeEnter(pBtree); + pPager = sqlite3BtreePager(pBtree); + assert( pPager!=0 ); + fd = sqlite3PagerFile(pPager); + assert( fd!=0 ); + if( op==SQLITE_FCNTL_FILE_POINTER ){ + *(sqlite3_file**)pArg = fd; + rc = SQLITE_OK; + }else if( fd->pMethods ){ + rc = sqlite3OsFileControl(fd, op, pArg); + }else{ + rc = SQLITE_NOTFOUND; + } + sqlite3BtreeLeave(pBtree); + } } sqlite3_mutex_leave(db->mutex); return rc; } @@ -115874,12 +115186,11 @@ /* ** Return a boolean value for a query parameter. */ SQLITE_API int sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){ const char *z = sqlite3_uri_parameter(zFilename, zParam); - bDflt = bDflt!=0; - return z ? sqlite3GetBoolean(z, bDflt) : bDflt; + return z ? sqlite3GetBoolean(z) : (bDflt!=0); } /* ** Return a 64-bit integer value for a query parameter. */ @@ -115894,41 +115205,22 @@ bDflt = v; } return bDflt; } -/* -** Return the Btree pointer identified by zDbName. Return NULL if not found. -*/ -SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3 *db, const char *zDbName){ - int i; - for(i=0; inDb; i++){ - if( db->aDb[i].pBt - && (zDbName==0 || sqlite3StrICmp(zDbName, db->aDb[i].zName)==0) - ){ - return db->aDb[i].pBt; - } - } - return 0; -} - /* ** Return the filename of the database associated with a database ** connection. */ SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName){ - Btree *pBt = sqlite3DbNameToBtree(db, zDbName); - return pBt ? sqlite3BtreeGetFilename(pBt) : 0; -} - -/* -** Return 1 if database is read-only or 0 if read/write. Return -1 if -** no such database exists. -*/ -SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ - Btree *pBt = sqlite3DbNameToBtree(db, zDbName); - return pBt ? sqlite3PagerIsreadonly(sqlite3BtreePager(pBt)) : -1; + int i; + for(i=0; inDb; i++){ + if( db->aDb[i].pBt && sqlite3StrICmp(zDbName, db->aDb[i].zName)==0 ){ + return sqlite3BtreeGetFilename(db->aDb[i].pBt); + } + } + return 0; } /************** End of main.c ************************************************/ /************** Begin file notify.c ******************************************/ /* @@ -116334,11 +115626,11 @@ ** option. But that functionality is no longer supported. ** ** A doclist is stored like this: ** ** array { -** varint docid; (delta from previous doclist) +** varint docid; ** array { (position list for column 0) ** varint position; (2 more than the delta from previous position) ** } ** array { ** varint POS_COLUMN; (marks start of position list for new column) @@ -116365,12 +115657,12 @@ ** The 123 value is the first docid. For column zero in this document ** there are two matches at positions 3 and 10 (5-2 and 9-2+3). The 1 ** at D signals the start of a new column; the 1 at E indicates that the ** new column is column number 1. There are two positions at 12 and 45 ** (14-2 and 35-2+12). The 0 at H indicate the end-of-document. The -** 234 at I is the delta to next docid (357). It has one position 70 -** (72-2) and then terminates with the 0 at K. +** 234 at I is the next docid. It has one position 72 (72-2) and then +** terminates with the 0 at K. ** ** A "position-list" is the list of positions for multiple columns for ** a single docid. A "column-list" is the set of positions for a single ** column. Hence, a position-list consists of one or more column-lists, ** a document record consists of a docid followed by a position-list and @@ -116550,10 +115842,14 @@ ** we simply write the new doclist. Segment merges overwrite older ** data for a particular docid with newer data, so deletes or updates ** will eventually overtake the earlier data and knock it out. The ** query logic likewise merges doclists so that newer data knocks out ** older data. +** +** TODO(shess) Provide a VACUUM type operation to clear out all +** deletions and duplications. This would basically be a forced merge +** into a single segment. */ /************** Include fts3Int.h in the middle of fts3.c ********************/ /************** Begin file fts3Int.h *****************************************/ /* @@ -116645,11 +115941,11 @@ typedef struct sqlite3_tokenizer_cursor sqlite3_tokenizer_cursor; struct sqlite3_tokenizer_module { /* - ** Structure version. Should always be set to 0 or 1. + ** Structure version. Should always be set to 0. */ int iVersion; /* ** Create a new tokenizer. The values in the argv[] array are the @@ -116726,19 +116022,10 @@ const char **ppToken, int *pnBytes, /* OUT: Normalized text for token */ int *piStartOffset, /* OUT: Byte offset of token in input buffer */ int *piEndOffset, /* OUT: Byte offset of end of token in input buffer */ int *piPosition /* OUT: Number of tokens returned before this one */ ); - - /*********************************************************************** - ** Methods below this point are only available if iVersion>=1. - */ - - /* - ** Configure the language id of a tokenizer cursor. - */ - int (*xLanguageid)(sqlite3_tokenizer_cursor *pCsr, int iLangid); }; struct sqlite3_tokenizer { const sqlite3_tokenizer_module *pModule; /* The module for this tokenizer */ /* Tokenizer implementations will typically add additional fields */ @@ -116901,13 +116188,10 @@ #ifndef MIN # define MIN(x,y) ((x)<(y)?(x):(y)) #endif -#ifndef MAX -# define MAX(x,y) ((x)>(y)?(x):(y)) -#endif /* ** Maximum length of a varint encoded integer. The varint format is different ** from that used by SQLite, so the maximum length is 10, not 9. */ @@ -116958,21 +116242,20 @@ #ifdef SQLITE_COVERAGE_TEST # define ALWAYS(x) (1) # define NEVER(X) (0) #else # define ALWAYS(x) (x) -# define NEVER(x) (x) +# define NEVER(X) (x) #endif /* ** Internal types used by SQLite. */ typedef unsigned char u8; /* 1-byte (or larger) unsigned integer */ typedef short int i16; /* 2-byte (or larger) signed integer */ typedef unsigned int u32; /* 4-byte unsigned integer */ typedef sqlite3_uint64 u64; /* 8-byte unsigned integer */ -typedef sqlite3_int64 i64; /* 8-byte signed integer */ /* ** Macro used to suppress compiler warnings for unused parameters. */ #define UNUSED_PARAMETER(x) (void)(x) @@ -117030,64 +116313,55 @@ const char *zName; /* virtual table name */ int nColumn; /* number of named columns in virtual table */ char **azColumn; /* column names. malloced */ sqlite3_tokenizer *pTokenizer; /* tokenizer for inserts and queries */ char *zContentTbl; /* content=xxx option, or NULL */ - char *zLanguageid; /* languageid=xxx option, or NULL */ - u8 bAutoincrmerge; /* True if automerge=1 */ - u32 nLeafAdd; /* Number of leaf blocks added this trans */ /* Precompiled statements used by the implementation. Each of these ** statements is run and reset within a single virtual table API call. */ - sqlite3_stmt *aStmt[37]; + sqlite3_stmt *aStmt[27]; char *zReadExprlist; char *zWriteExprlist; int nNodeSize; /* Soft limit for node size */ - u8 bFts4; /* True for FTS4, false for FTS3 */ u8 bHasStat; /* True if %_stat table exists */ u8 bHasDocsize; /* True if %_docsize table exists */ u8 bDescIdx; /* True if doclists are in reverse order */ - u8 bIgnoreSavepoint; /* True to ignore xSavepoint invocations */ int nPgsz; /* Page size for host database */ char *zSegmentsTbl; /* Name of %_segments table */ sqlite3_blob *pSegments; /* Blob handle open on %_segments table */ - /* - ** The following array of hash tables is used to buffer pending index - ** updates during transactions. All pending updates buffered at any one - ** time must share a common language-id (see the FTS4 langid= feature). - ** The current language id is stored in variable iPrevLangid. + /* TODO: Fix the first paragraph of this comment. + ** + ** The following hash table is used to buffer pending index updates during + ** transactions. Variable nPendingData estimates the memory size of the + ** pending data, including hash table overhead, but not malloc overhead. + ** When nPendingData exceeds nMaxPendingData, the buffer is flushed + ** automatically. Variable iPrevDocid is the docid of the most recently + ** inserted record. ** ** A single FTS4 table may have multiple full-text indexes. For each index ** there is an entry in the aIndex[] array. Index 0 is an index of all the ** terms that appear in the document set. Each subsequent index in aIndex[] ** is an index of prefixes of a specific length. - ** - ** Variable nPendingData contains an estimate the memory consumed by the - ** pending data structures, including hash table overhead, but not including - ** malloc overhead. When nPendingData exceeds nMaxPendingData, all hash - ** tables are flushed to disk. Variable iPrevDocid is the docid of the most - ** recently inserted record. */ int nIndex; /* Size of aIndex[] */ struct Fts3Index { int nPrefix; /* Prefix length (0 for main terms index) */ Fts3Hash hPending; /* Pending terms table for this index */ } *aIndex; int nMaxPendingData; /* Max pending data before flush to disk */ int nPendingData; /* Current bytes of pending data */ sqlite_int64 iPrevDocid; /* Docid of most recently inserted document */ - int iPrevLangid; /* Langid of recently inserted document */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) /* State variables used for validating that the transaction control ** methods of the virtual table are called at appropriate times. These - ** values do not contribute to FTS functionality; they are used for - ** verifying the operation of the SQLite core. + ** values do not contribution to the FTS computation; they are used for + ** verifying the SQLite core. */ int inTransaction; /* True after xBegin but before xCommit/xRollback */ int mxSavepoint; /* Largest valid xSavepoint integer */ #endif }; @@ -117102,11 +116376,10 @@ i16 eSearch; /* Search strategy (see below) */ u8 isEof; /* True if at End Of Results */ u8 isRequireSeek; /* True if must seek pStmt to %_content row */ sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ Fts3Expr *pExpr; /* Parsed MATCH query string */ - int iLangid; /* Language being queried for */ int nPhrase; /* Number of matchable phrases in query */ Fts3DeferredToken *pDeferred; /* Deferred search tokens, if any */ sqlite3_int64 iPrevId; /* Previous id read from aDoclist */ char *pNextId; /* Pointer into the body of aDoclist */ char *aDoclist; /* List of docids for full-text queries */ @@ -117249,16 +116522,16 @@ /* fts3_write.c */ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod(sqlite3_vtab*,int,sqlite3_value**,sqlite3_int64*); SQLITE_PRIVATE int sqlite3Fts3PendingTermsFlush(Fts3Table *); SQLITE_PRIVATE void sqlite3Fts3PendingTermsClear(Fts3Table *); SQLITE_PRIVATE int sqlite3Fts3Optimize(Fts3Table *); -SQLITE_PRIVATE int sqlite3Fts3SegReaderNew(int, int, sqlite3_int64, +SQLITE_PRIVATE int sqlite3Fts3SegReaderNew(int, sqlite3_int64, sqlite3_int64, sqlite3_int64, const char *, int, Fts3SegReader**); SQLITE_PRIVATE int sqlite3Fts3SegReaderPending( Fts3Table*,int,const char*,int,int,Fts3SegReader**); SQLITE_PRIVATE void sqlite3Fts3SegReaderFree(Fts3SegReader *); -SQLITE_PRIVATE int sqlite3Fts3AllSegdirs(Fts3Table*, int, int, int, sqlite3_stmt **); +SQLITE_PRIVATE int sqlite3Fts3AllSegdirs(Fts3Table*, int, int, sqlite3_stmt **); SQLITE_PRIVATE int sqlite3Fts3ReadLock(Fts3Table *); SQLITE_PRIVATE int sqlite3Fts3ReadBlock(Fts3Table*, sqlite3_int64, char **, int*, int*); SQLITE_PRIVATE int sqlite3Fts3SelectDoctotal(Fts3Table *, sqlite3_stmt **); SQLITE_PRIVATE int sqlite3Fts3SelectDocsize(Fts3Table *, sqlite3_int64, sqlite3_stmt **); @@ -117266,22 +116539,21 @@ SQLITE_PRIVATE void sqlite3Fts3FreeDeferredTokens(Fts3Cursor *); SQLITE_PRIVATE int sqlite3Fts3DeferToken(Fts3Cursor *, Fts3PhraseToken *, int); SQLITE_PRIVATE int sqlite3Fts3CacheDeferredDoclists(Fts3Cursor *); SQLITE_PRIVATE void sqlite3Fts3FreeDeferredDoclists(Fts3Cursor *); SQLITE_PRIVATE void sqlite3Fts3SegmentsClose(Fts3Table *); -SQLITE_PRIVATE int sqlite3Fts3MaxLevel(Fts3Table *, int *); /* Special values interpreted by sqlite3SegReaderCursor() */ #define FTS3_SEGCURSOR_PENDING -1 #define FTS3_SEGCURSOR_ALL -2 SQLITE_PRIVATE int sqlite3Fts3SegReaderStart(Fts3Table*, Fts3MultiSegReader*, Fts3SegFilter*); SQLITE_PRIVATE int sqlite3Fts3SegReaderStep(Fts3Table *, Fts3MultiSegReader *); SQLITE_PRIVATE void sqlite3Fts3SegReaderFinish(Fts3MultiSegReader *); -SQLITE_PRIVATE int sqlite3Fts3SegReaderCursor(Fts3Table *, - int, int, int, const char *, int, int, int, Fts3MultiSegReader *); +SQLITE_PRIVATE int sqlite3Fts3SegReaderCursor( + Fts3Table *, int, int, const char *, int, int, int, Fts3MultiSegReader *); /* Flags allowed as part of the 4th argument to SegmentReaderIterate() */ #define FTS3_SEGMENT_REQUIRE_POS 0x00000001 #define FTS3_SEGMENT_IGNORE_EMPTY 0x00000002 #define FTS3_SEGMENT_COLUMN_FILTER 0x00000004 @@ -117318,22 +116590,19 @@ int nTerm; /* Size of zTerm in bytes */ char *aDoclist; /* Pointer to doclist buffer */ int nDoclist; /* Size of aDoclist[] in bytes */ }; -SQLITE_PRIVATE int sqlite3Fts3Incrmerge(Fts3Table*,int,int); - /* fts3.c */ SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *, sqlite3_int64); SQLITE_PRIVATE int sqlite3Fts3GetVarint(const char *, sqlite_int64 *); SQLITE_PRIVATE int sqlite3Fts3GetVarint32(const char *, int *); SQLITE_PRIVATE int sqlite3Fts3VarintLen(sqlite3_uint64); SQLITE_PRIVATE void sqlite3Fts3Dequote(char *); SQLITE_PRIVATE void sqlite3Fts3DoclistPrev(int,char*,int,char**,sqlite3_int64*,int*,u8*); SQLITE_PRIVATE int sqlite3Fts3EvalPhraseStats(Fts3Cursor *, Fts3Expr *, u32 *); SQLITE_PRIVATE int sqlite3Fts3FirstFilter(sqlite3_int64, char *, int, char *); -SQLITE_PRIVATE void sqlite3Fts3CreateStatTable(int*, Fts3Table*); /* fts3_tokenizer.c */ SQLITE_PRIVATE const char *sqlite3Fts3NextToken(const char *, int *); SQLITE_PRIVATE int sqlite3Fts3InitHashTable(sqlite3 *, Fts3Hash *, const char *); SQLITE_PRIVATE int sqlite3Fts3InitTokenizer(Fts3Hash *pHash, const char *, @@ -117347,33 +116616,29 @@ const char *, const char *, int, int ); SQLITE_PRIVATE void sqlite3Fts3Matchinfo(sqlite3_context *, Fts3Cursor *, const char *); /* fts3_expr.c */ -SQLITE_PRIVATE int sqlite3Fts3ExprParse(sqlite3_tokenizer *, int, +SQLITE_PRIVATE int sqlite3Fts3ExprParse(sqlite3_tokenizer *, char **, int, int, int, const char *, int, Fts3Expr ** ); SQLITE_PRIVATE void sqlite3Fts3ExprFree(Fts3Expr *); #ifdef SQLITE_TEST SQLITE_PRIVATE int sqlite3Fts3ExprInitTestInterface(sqlite3 *db); SQLITE_PRIVATE int sqlite3Fts3InitTerm(sqlite3 *db); #endif -SQLITE_PRIVATE int sqlite3Fts3OpenTokenizer(sqlite3_tokenizer *, int, const char *, int, - sqlite3_tokenizer_cursor ** -); - /* fts3_aux.c */ SQLITE_PRIVATE int sqlite3Fts3InitAux(sqlite3 *db); SQLITE_PRIVATE void sqlite3Fts3EvalPhraseCleanup(Fts3Phrase *); SQLITE_PRIVATE int sqlite3Fts3MsrIncrStart( Fts3Table*, Fts3MultiSegReader*, int, const char*, int); SQLITE_PRIVATE int sqlite3Fts3MsrIncrNext( Fts3Table *, Fts3MultiSegReader *, sqlite3_int64 *, char **, int *); -SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol, char **); +SQLITE_PRIVATE char *sqlite3Fts3EvalPhrasePoslist(Fts3Cursor *, Fts3Expr *, int iCol); SQLITE_PRIVATE int sqlite3Fts3MsrOvfl(Fts3Cursor *, Fts3MultiSegReader *, int *); SQLITE_PRIVATE int sqlite3Fts3MsrIncrRestart(Fts3MultiSegReader *pCsr); SQLITE_PRIVATE int sqlite3Fts3DeferredTokenList(Fts3DeferredToken *, char **, int *); @@ -117554,11 +116819,10 @@ } sqlite3_free(p->zSegmentsTbl); sqlite3_free(p->zReadExprlist); sqlite3_free(p->zWriteExprlist); sqlite3_free(p->zContentTbl); - sqlite3_free(p->zLanguageid); /* Invoke the tokenizer destructor to free the tokenizer. */ p->pTokenizer->pModule->xDestroy(p->pTokenizer); sqlite3_free(p); @@ -117631,13 +116895,11 @@ if( *pRc==SQLITE_OK ){ int i; /* Iterator variable */ int rc; /* Return code */ char *zSql; /* SQL statement passed to declare_vtab() */ char *zCols; /* List of user defined columns */ - const char *zLanguageid; - zLanguageid = (p->zLanguageid ? p->zLanguageid : "__langid"); sqlite3_vtab_config(p->db, SQLITE_VTAB_CONSTRAINT_SUPPORT, 1); /* Create a list of user columns for the virtual table */ zCols = sqlite3_mprintf("%Q, ", p->azColumn[0]); for(i=1; zCols && inColumn; i++){ @@ -117644,12 +116906,11 @@ zCols = sqlite3_mprintf("%z%Q, ", zCols, p->azColumn[i]); } /* Create the whole "CREATE TABLE" statement to pass to SQLite */ zSql = sqlite3_mprintf( - "CREATE TABLE x(%s %Q HIDDEN, docid HIDDEN, %Q HIDDEN)", - zCols, p->zName, zLanguageid + "CREATE TABLE x(%s %Q HIDDEN, docid HIDDEN)", zCols, p->zName ); if( !zCols || !zSql ){ rc = SQLITE_NOMEM; }else{ rc = sqlite3_declare_vtab(p->db, zSql); @@ -117659,22 +116920,10 @@ sqlite3_free(zCols); *pRc = rc; } } -/* -** Create the %_stat table if it does not already exist. -*/ -SQLITE_PRIVATE void sqlite3Fts3CreateStatTable(int *pRc, Fts3Table *p){ - fts3DbExec(pRc, p->db, - "CREATE TABLE IF NOT EXISTS %Q.'%q_stat'" - "(id INTEGER PRIMARY KEY, value BLOB);", - p->zDb, p->zName - ); - if( (*pRc)==SQLITE_OK ) p->bHasStat = 1; -} - /* ** Create the backing store tables (%_content, %_segments and %_segdir) ** required by the FTS3 table passed as the only argument. This is done ** as part of the vtab xCreate() method. ** @@ -117686,22 +116935,18 @@ int rc = SQLITE_OK; /* Return code */ int i; /* Iterator variable */ sqlite3 *db = p->db; /* The database connection */ if( p->zContentTbl==0 ){ - const char *zLanguageid = p->zLanguageid; char *zContentCols; /* Columns of %_content table */ /* Create a list of user columns for the content table */ zContentCols = sqlite3_mprintf("docid INTEGER PRIMARY KEY"); for(i=0; zContentCols && inColumn; i++){ char *z = p->azColumn[i]; zContentCols = sqlite3_mprintf("%z, 'c%d%q'", zContentCols, i, z); } - if( zLanguageid && zContentCols ){ - zContentCols = sqlite3_mprintf("%z, langid", zContentCols, zLanguageid); - } if( zContentCols==0 ) rc = SQLITE_NOMEM; /* Create the content table */ fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_content'(%s)", @@ -117731,13 +116976,15 @@ fts3DbExec(&rc, db, "CREATE TABLE %Q.'%q_docsize'(docid INTEGER PRIMARY KEY, size BLOB);", p->zDb, p->zName ); } - assert( p->bHasStat==p->bFts4 ); if( p->bHasStat ){ - sqlite3Fts3CreateStatTable(&rc, p); + fts3DbExec(&rc, db, + "CREATE TABLE %Q.'%q_stat'(id INTEGER PRIMARY KEY, value BLOB);", + p->zDb, p->zName + ); } return rc; } /* @@ -117840,11 +117087,11 @@ ** memory. */ static char *fts3QuoteId(char const *zInput){ int nRet; char *zRet; - nRet = 2 + (int)strlen(zInput)*2 + 1; + nRet = 2 + strlen(zInput)*2 + 1; zRet = sqlite3_malloc(nRet); if( zRet ){ int i; char *z = zRet; *(z++) = '"'; @@ -117895,24 +117142,18 @@ } fts3Appendf(pRc, &zRet, "docid"); for(i=0; inColumn; i++){ fts3Appendf(pRc, &zRet, ",%s(x.'c%d%q')", zFunction, i, p->azColumn[i]); } - if( p->zLanguageid ){ - fts3Appendf(pRc, &zRet, ", x.%Q", "langid"); - } sqlite3_free(zFree); }else{ fts3Appendf(pRc, &zRet, "rowid"); for(i=0; inColumn; i++){ fts3Appendf(pRc, &zRet, ", x.'%q'", p->azColumn[i]); } - if( p->zLanguageid ){ - fts3Appendf(pRc, &zRet, ", x.%Q", p->zLanguageid); - } } - fts3Appendf(pRc, &zRet, " FROM '%q'.'%q%s' AS x", + fts3Appendf(pRc, &zRet, "FROM '%q'.'%q%s' AS x", p->zDb, (p->zContentTbl ? p->zContentTbl : p->zName), (p->zContentTbl ? "" : "_content") ); return zRet; @@ -117951,13 +117192,10 @@ } fts3Appendf(pRc, &zRet, "?"); for(i=0; inColumn; i++){ fts3Appendf(pRc, &zRet, ",%s(?)", zFunction); } - if( p->zLanguageid ){ - fts3Appendf(pRc, &zRet, ", ?"); - } sqlite3_free(zFree); return zRet; } /* @@ -118096,11 +117334,11 @@ ** space required to store a copy of each column name, including the ** nul-terminator byte. */ nCol = sqlite3_column_count(pStmt); for(i=0; i MATCHINFO */ { "prefix", 6 }, /* 1 -> PREFIX */ { "compress", 8 }, /* 2 -> COMPRESS */ { "uncompress", 10 }, /* 3 -> UNCOMPRESS */ { "order", 5 }, /* 4 -> ORDER */ - { "content", 7 }, /* 5 -> CONTENT */ - { "languageid", 10 } /* 6 -> LANGUAGEID */ + { "content", 7 } /* 5 -> CONTENT */ }; int iOpt; if( !zVal ){ rc = SQLITE_NOMEM; @@ -118274,22 +117510,16 @@ rc = SQLITE_ERROR; } bDescIdx = (zVal[0]=='d' || zVal[0]=='D'); break; - case 5: /* CONTENT */ - sqlite3_free(zContent); + default: /* CONTENT */ + assert( iOpt==5 ); + sqlite3_free(zUncompress); zContent = zVal; zVal = 0; break; - - case 6: /* LANGUAGEID */ - assert( iOpt==6 ); - sqlite3_free(zLanguageid); - zLanguageid = zVal; - zVal = 0; - break; } } sqlite3_free(zVal); } } @@ -118315,25 +117545,12 @@ zUncompress = 0; if( nCol==0 ){ sqlite3_free((void*)aCol); aCol = 0; rc = fts3ContentColumns(db, argv[1], zContent, &aCol, &nCol, &nString); - - /* If a languageid= option was specified, remove the language id - ** column from the aCol[] array. */ - if( rc==SQLITE_OK && zLanguageid ){ - int j; - for(j=0; j0 ); } if( rc!=SQLITE_OK ) goto fts3_init_out; if( nCol==0 ){ assert( nString==0 ); @@ -118374,17 +117591,13 @@ p->azColumn = (char **)&p[1]; p->pTokenizer = pTokenizer; p->nMaxPendingData = FTS3_MAX_PENDING_DATA; p->bHasDocsize = (isFts4 && bNoDocsize==0); p->bHasStat = isFts4; - p->bFts4 = isFts4; p->bDescIdx = bDescIdx; - p->bAutoincrmerge = 0xff; /* 0xff means setting unknown */ p->zContentTbl = zContent; - p->zLanguageid = zLanguageid; zContent = 0; - zLanguageid = 0; TESTONLY( p->inTransaction = -1 ); TESTONLY( p->mxSavepoint = -1 ); p->aIndex = (struct Fts3Index *)&p->azColumn[nCol]; memcpy(p->aIndex, aIndex, sizeof(struct Fts3Index) * nIndex); @@ -118429,20 +117642,10 @@ */ if( isCreate ){ rc = fts3CreateTables(p); } - /* Check to see if a legacy fts3 table has been "upgraded" by the - ** addition of a %_stat table so that it can use incremental merge. - */ - if( !isFts4 && !isCreate ){ - int rc2 = SQLITE_OK; - fts3DbExec(&rc2, db, "SELECT 1 FROM %Q.'%q_stat' WHERE id=2", - p->zDb, p->zName); - if( rc2==SQLITE_OK ) p->bHasStat = 1; - } - /* Figure out the page-size for the database. This is required in order to ** estimate the cost of loading large doclists from the database. */ fts3DatabasePageSize(&rc, p); p->nNodeSize = p->nPgsz-35; @@ -118453,11 +117656,10 @@ sqlite3_free(zPrefix); sqlite3_free(aIndex); sqlite3_free(zCompress); sqlite3_free(zUncompress); sqlite3_free(zContent); - sqlite3_free(zLanguageid); sqlite3_free((void *)aCol); if( rc!=SQLITE_OK ){ if( p ){ fts3DisconnectMethod((sqlite3_vtab *)p); }else if( pTokenizer ){ @@ -118505,11 +117707,10 @@ */ static int fts3BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){ Fts3Table *p = (Fts3Table *)pVTab; int i; /* Iterator variable */ int iCons = -1; /* Index of constraint to use */ - int iLangidCons = -1; /* Index of langid=x constraint, if present */ /* By default use a full table scan. This is an expensive option, ** so search through the constraints to see if a more efficient ** strategy is possible. */ @@ -118518,12 +117719,11 @@ for(i=0; inConstraint; i++){ struct sqlite3_index_constraint *pCons = &pInfo->aConstraint[i]; if( pCons->usable==0 ) continue; /* A direct lookup on the rowid or docid column. Assign a cost of 1.0. */ - if( iCons<0 - && pCons->op==SQLITE_INDEX_CONSTRAINT_EQ + if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ && (pCons->iColumn<0 || pCons->iColumn==p->nColumn+1 ) ){ pInfo->idxNum = FTS3_DOCID_SEARCH; pInfo->estimatedCost = 1.0; iCons = i; @@ -118542,27 +117742,18 @@ && pCons->iColumn>=0 && pCons->iColumn<=p->nColumn ){ pInfo->idxNum = FTS3_FULLTEXT_SEARCH + pCons->iColumn; pInfo->estimatedCost = 2.0; iCons = i; - } - - /* Equality constraint on the langid column */ - if( pCons->op==SQLITE_INDEX_CONSTRAINT_EQ - && pCons->iColumn==p->nColumn + 2 - ){ - iLangidCons = i; + break; } } if( iCons>=0 ){ pInfo->aConstraintUsage[iCons].argvIndex = 1; pInfo->aConstraintUsage[iCons].omit = 1; } - if( iLangidCons>=0 ){ - pInfo->aConstraintUsage[iLangidCons].argvIndex = 2; - } /* Regardless of the strategy selected, FTS can deliver rows in rowid (or ** docid) order. Both ascending and descending are possible. */ if( pInfo->nOrderBy==1 ){ @@ -119442,11 +118633,11 @@ fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); } } *paOut = aOut; - *pnOut = (int)(p-aOut); + *pnOut = (p-aOut); assert( *pnOut<=n1+n2+FTS3_VARINT_MAX-1 ); return SQLITE_OK; } /* @@ -119506,11 +118697,11 @@ fts3PoslistCopy(0, &p2); fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2); } } - *pnRight = (int)(p - aOut); + *pnRight = p - aOut; } /* ** Argument pList points to a position list nList bytes in size. This ** function checks to see if the position list contains any entries for @@ -119708,11 +118899,10 @@ ** This function returns SQLITE_OK if successful, or an SQLite error code ** otherwise. */ static int fts3SegReaderCursor( Fts3Table *p, /* FTS3 table handle */ - int iLangid, /* Language id */ int iIndex, /* Index to search (from 0 to p->nIndex-1) */ int iLevel, /* Level of segments to scan */ const char *zTerm, /* Term to query for */ int nTerm, /* Size of zTerm in bytes */ int isPrefix, /* True for a prefix search */ @@ -119737,11 +118927,11 @@ } } if( iLevel!=FTS3_SEGCURSOR_PENDING ){ if( rc==SQLITE_OK ){ - rc = sqlite3Fts3AllSegdirs(p, iLangid, iIndex, iLevel, &pStmt); + rc = sqlite3Fts3AllSegdirs(p, iIndex, iLevel, &pStmt); } while( rc==SQLITE_OK && SQLITE_ROW==(rc = sqlite3_step(pStmt)) ){ Fts3SegReader *pSeg = 0; @@ -119760,13 +118950,11 @@ if( rc!=SQLITE_OK ) goto finished; if( isPrefix==0 && isScan==0 ) iLeavesEndBlock = iStartBlock; } rc = sqlite3Fts3SegReaderNew(pCsr->nSegment+1, - (isPrefix==0 && isScan==0), - iStartBlock, iLeavesEndBlock, - iEndBlock, zRoot, nRoot, &pSeg + iStartBlock, iLeavesEndBlock, iEndBlock, zRoot, nRoot, &pSeg ); if( rc!=SQLITE_OK ) goto finished; rc = fts3SegReaderCursorAppend(pCsr, pSeg); } } @@ -119782,11 +118970,10 @@ ** Set up a cursor object for iterating through a full-text index or a ** single level therein. */ SQLITE_PRIVATE int sqlite3Fts3SegReaderCursor( Fts3Table *p, /* FTS3 table handle */ - int iLangid, /* Language-id to search */ int iIndex, /* Index to search (from 0 to p->nIndex-1) */ int iLevel, /* Level of segments to scan */ const char *zTerm, /* Term to query for */ int nTerm, /* Size of zTerm in bytes */ int isPrefix, /* True for a prefix search */ @@ -119799,14 +118986,19 @@ || iLevel>=0 ); assert( iLevelaIndex==0 ); memset(pCsr, 0, sizeof(Fts3MultiSegReader)); + return fts3SegReaderCursor( - p, iLangid, iIndex, iLevel, zTerm, nTerm, isPrefix, isScan, pCsr + p, iIndex, iLevel, zTerm, nTerm, isPrefix, isScan, pCsr ); } /* ** In addition to its current configuration, have the Fts3MultiSegReader @@ -119814,18 +119006,15 @@ ** ** SQLITE_OK is returned if no error occurs, otherwise an SQLite error code. */ static int fts3SegReaderCursorAddZero( Fts3Table *p, /* FTS virtual table handle */ - int iLangid, const char *zTerm, /* Term to scan doclist of */ int nTerm, /* Number of bytes in zTerm */ Fts3MultiSegReader *pCsr /* Fts3MultiSegReader to modify */ ){ - return fts3SegReaderCursor(p, - iLangid, 0, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 0, 0,pCsr - ); + return fts3SegReaderCursor(p, 0, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 0, 0,pCsr); } /* ** Open an Fts3MultiSegReader to scan the doclist for term zTerm/nTerm. Or, ** if isPrefix is true, to scan the doclist for all terms for which @@ -119857,35 +119046,32 @@ if( isPrefix ){ for(i=1; bFound==0 && inIndex; i++){ if( p->aIndex[i].nPrefix==nTerm ){ bFound = 1; - rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, - i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 0, 0, pSegcsr - ); + rc = sqlite3Fts3SegReaderCursor( + p, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 0, 0, pSegcsr); pSegcsr->bLookup = 1; } } for(i=1; bFound==0 && inIndex; i++){ if( p->aIndex[i].nPrefix==nTerm+1 ){ bFound = 1; - rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, - i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 1, 0, pSegcsr + rc = sqlite3Fts3SegReaderCursor( + p, i, FTS3_SEGCURSOR_ALL, zTerm, nTerm, 1, 0, pSegcsr ); if( rc==SQLITE_OK ){ - rc = fts3SegReaderCursorAddZero( - p, pCsr->iLangid, zTerm, nTerm, pSegcsr - ); + rc = fts3SegReaderCursorAddZero(p, zTerm, nTerm, pSegcsr); } } } } if( bFound==0 ){ - rc = sqlite3Fts3SegReaderCursor(p, pCsr->iLangid, - 0, FTS3_SEGCURSOR_ALL, zTerm, nTerm, isPrefix, 0, pSegcsr + rc = sqlite3Fts3SegReaderCursor( + p, 0, FTS3_SEGCURSOR_ALL, zTerm, nTerm, isPrefix, 0, pSegcsr ); pSegcsr->bLookup = !isPrefix; } } @@ -120036,11 +119222,11 @@ UNUSED_PARAMETER(idxStr); UNUSED_PARAMETER(nVal); assert( idxNum>=0 && idxNum<=(FTS3_FULLTEXT_SEARCH+p->nColumn) ); - assert( nVal==0 || nVal==1 || nVal==2 ); + assert( nVal==0 || nVal==1 ); assert( (nVal==0)==(idxNum==FTS3_FULLSCAN_SEARCH) ); assert( p->pSegments==0 ); /* In case the cursor has been used before, clear it now. */ sqlite3_finalize(pCsr->pStmt); @@ -120061,15 +119247,12 @@ if( zQuery==0 && sqlite3_value_type(apVal[0])!=SQLITE_NULL ){ return SQLITE_NOMEM; } - pCsr->iLangid = 0; - if( nVal==2 ) pCsr->iLangid = sqlite3_value_int(apVal[1]); - - rc = sqlite3Fts3ExprParse(p->pTokenizer, pCsr->iLangid, - p->azColumn, p->bFts4, p->nColumn, iCol, zQuery, -1, &pCsr->pExpr + rc = sqlite3Fts3ExprParse(p->pTokenizer, p->azColumn, p->bHasStat, + p->nColumn, iCol, zQuery, -1, &pCsr->pExpr ); if( rc!=SQLITE_OK ){ if( rc==SQLITE_ERROR ){ static const char *zErr = "malformed MATCH expression: [%s]"; p->base.zErrMsg = sqlite3_mprintf(zErr, zQuery); @@ -120136,56 +119319,37 @@ } /* ** This is the xColumn method, called by SQLite to request a value from ** the row that the supplied cursor currently points to. -** -** If: -** -** (iCol < p->nColumn) -> The value of the iCol'th user column. -** (iCol == p->nColumn) -> Magic column with the same name as the table. -** (iCol == p->nColumn+1) -> Docid column -** (iCol == p->nColumn+2) -> Langid column */ static int fts3ColumnMethod( sqlite3_vtab_cursor *pCursor, /* Cursor to retrieve value from */ - sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */ + sqlite3_context *pContext, /* Context for sqlite3_result_xxx() calls */ int iCol /* Index of column to read value from */ ){ int rc = SQLITE_OK; /* Return Code */ Fts3Cursor *pCsr = (Fts3Cursor *) pCursor; Fts3Table *p = (Fts3Table *)pCursor->pVtab; /* The column value supplied by SQLite must be in range. */ - assert( iCol>=0 && iCol<=p->nColumn+2 ); + assert( iCol>=0 && iCol<=p->nColumn+1 ); if( iCol==p->nColumn+1 ){ /* This call is a request for the "docid" column. Since "docid" is an ** alias for "rowid", use the xRowid() method to obtain the value. */ - sqlite3_result_int64(pCtx, pCsr->iPrevId); + sqlite3_result_int64(pContext, pCsr->iPrevId); }else if( iCol==p->nColumn ){ /* The extra column whose name is the same as the table. - ** Return a blob which is a pointer to the cursor. */ - sqlite3_result_blob(pCtx, &pCsr, sizeof(pCsr), SQLITE_TRANSIENT); - }else if( iCol==p->nColumn+2 && pCsr->pExpr ){ - sqlite3_result_int64(pCtx, pCsr->iLangid); + ** Return a blob which is a pointer to the cursor. + */ + sqlite3_result_blob(pContext, &pCsr, sizeof(pCsr), SQLITE_TRANSIENT); }else{ - /* The requested column is either a user column (one that contains - ** indexed data), or the language-id column. */ rc = fts3CursorSeek(0, pCsr); - - if( rc==SQLITE_OK ){ - if( iCol==p->nColumn+2 ){ - int iLangid = 0; - if( p->zLanguageid ){ - iLangid = sqlite3_column_int(pCsr->pStmt, p->nColumn+1); - } - sqlite3_result_int(pCtx, iLangid); - }else if( sqlite3_data_count(pCsr->pStmt)>(iCol+1) ){ - sqlite3_result_value(pCtx, sqlite3_column_value(pCsr->pStmt, iCol+1)); - } + if( rc==SQLITE_OK && sqlite3_data_count(pCsr->pStmt)>(iCol+1) ){ + sqlite3_result_value(pContext, sqlite3_column_value(pCsr->pStmt, iCol+1)); } } assert( ((Fts3Table *)pCsr->base.pVtab)->pSegments==0 ); return rc; @@ -120208,61 +119372,26 @@ /* ** Implementation of xSync() method. Flush the contents of the pending-terms ** hash-table to the database. */ static int fts3SyncMethod(sqlite3_vtab *pVtab){ - - /* Following an incremental-merge operation, assuming that the input - ** segments are not completely consumed (the usual case), they are updated - ** in place to remove the entries that have already been merged. This - ** involves updating the leaf block that contains the smallest unmerged - ** entry and each block (if any) between the leaf and the root node. So - ** if the height of the input segment b-trees is N, and input segments - ** are merged eight at a time, updating the input segments at the end - ** of an incremental-merge requires writing (8*(1+N)) blocks. N is usually - ** small - often between 0 and 2. So the overhead of the incremental - ** merge is somewhere between 8 and 24 blocks. To avoid this overhead - ** dwarfing the actual productive work accomplished, the incremental merge - ** is only attempted if it will write at least 64 leaf blocks. Hence - ** nMinMerge. - ** - ** Of course, updating the input segments also involves deleting a bunch - ** of blocks from the segments table. But this is not considered overhead - ** as it would also be required by a crisis-merge that used the same input - ** segments. - */ - const u32 nMinMerge = 64; /* Minimum amount of incr-merge work to do */ - - Fts3Table *p = (Fts3Table*)pVtab; - int rc = sqlite3Fts3PendingTermsFlush(p); - - if( rc==SQLITE_OK && p->bAutoincrmerge==1 && p->nLeafAdd>(nMinMerge/16) ){ - int mxLevel = 0; /* Maximum relative level value in db */ - int A; /* Incr-merge parameter A */ - - rc = sqlite3Fts3MaxLevel(p, &mxLevel); - assert( rc==SQLITE_OK || mxLevel==0 ); - A = p->nLeafAdd * mxLevel; - A += (A/2); - if( A>(int)nMinMerge ) rc = sqlite3Fts3Incrmerge(p, A, 8); - } - sqlite3Fts3SegmentsClose(p); + int rc = sqlite3Fts3PendingTermsFlush((Fts3Table *)pVtab); + sqlite3Fts3SegmentsClose((Fts3Table *)pVtab); return rc; } /* ** Implementation of xBegin() method. This is a no-op. */ static int fts3BeginMethod(sqlite3_vtab *pVtab){ - Fts3Table *p = (Fts3Table*)pVtab; + TESTONLY( Fts3Table *p = (Fts3Table*)pVtab ); UNUSED_PARAMETER(pVtab); assert( p->pSegments==0 ); assert( p->nPendingData==0 ); assert( p->inTransaction!=1 ); TESTONLY( p->inTransaction = 1 ); TESTONLY( p->mxSavepoint = -1; ); - p->nLeafAdd = 0; return SQLITE_OK; } /* ** Implementation of xCommit() method. This is a no-op. The contents of @@ -120553,19 +119682,15 @@ ** The xSavepoint() method. ** ** Flush the contents of the pending-terms table to disk. */ static int fts3SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){ - int rc = SQLITE_OK; UNUSED_PARAMETER(iSavepoint); assert( ((Fts3Table *)pVtab)->inTransaction ); assert( ((Fts3Table *)pVtab)->mxSavepoint < iSavepoint ); TESTONLY( ((Fts3Table *)pVtab)->mxSavepoint = iSavepoint ); - if( ((Fts3Table *)pVtab)->bIgnoreSavepoint==0 ){ - rc = fts3SyncMethod(pVtab); - } - return rc; + return fts3SyncMethod(pVtab); } /* ** The xRelease() method. ** @@ -120921,11 +120046,11 @@ assert( iPrev>=0 ); fts3PoslistPhraseMerge(&aOut, iToken-iPrev, 0, 1, &p1, &p2); sqlite3_free(aPoslist); aPoslist = pList; - nPoslist = (int)(aOut - aPoslist); + nPoslist = aOut - aPoslist; if( nPoslist==0 ){ sqlite3_free(aPoslist); pPhrase->doclist.pList = 0; pPhrase->doclist.nList = 0; return SQLITE_OK; @@ -120965,11 +120090,11 @@ } pPhrase->doclist.pList = aOut; if( fts3PoslistPhraseMerge(&aOut, nDistance, 0, 1, &p1, &p2) ){ pPhrase->doclist.bFreeList = 1; - pPhrase->doclist.nList = (int)(aOut - pPhrase->doclist.pList); + pPhrase->doclist.nList = (aOut - pPhrase->doclist.pList); }else{ sqlite3_free(aOut); pPhrase->doclist.pList = 0; pPhrase->doclist.nList = 0; } @@ -121034,11 +120159,11 @@ int bDescIdx, /* True if the doclist is desc */ char *aDoclist, /* Pointer to entire doclist */ int nDoclist, /* Length of aDoclist in bytes */ char **ppIter, /* IN/OUT: Iterator pointer */ sqlite3_int64 *piDocid, /* IN/OUT: Docid pointer */ - int *pnList, /* OUT: List length pointer */ + int *pnList, /* IN/OUT: List length pointer */ u8 *pbEof /* OUT: End-of-file flag */ ){ char *p = *ppIter; assert( nDoclist>0 ); @@ -121061,11 +120186,11 @@ fts3PoslistCopy(0, &pDocid); while( pDocid0 ); - assert( *pbEof==0 ); - assert( p || *piDocid==0 ); - assert( !p || (p>=aDoclist && p<=&aDoclist[nDoclist]) ); - - if( p==0 ){ - p = aDoclist; - p += sqlite3Fts3GetVarint(p, piDocid); - }else{ - fts3PoslistCopy(0, &p); - if( p>=&aDoclist[nDoclist] ){ - *pbEof = 1; - }else{ - sqlite3_int64 iVar; - p += sqlite3Fts3GetVarint(p, &iVar); - *piDocid += ((bDescIdx ? -1 : 1) * iVar); - } - } - - *ppIter = p; + *pnList = (pSave - p); + } + *ppIter = p; + } } /* ** Attempt to move the phrase iterator to point to the next matching docid. ** If an error occurs, return an SQLite error code. Otherwise, return @@ -121170,11 +120260,11 @@ }else{ pDL->iDocid -= iDelta; } pDL->pList = pIter; fts3PoslistCopy(0, &pIter); - pDL->nList = (int)(pIter - pDL->pList); + pDL->nList = (pIter - pDL->pList); /* pIter now points just past the 0x00 that terminates the position- ** list for document pDL->iDocid. However, if this position-list was ** edited in place by fts3EvalNearTrim(), then pIter may not actually ** point to the start of the next docid value. The following line deals @@ -121511,11 +120601,11 @@ /* Allocate a MultiSegReader for each token in the expression. */ fts3EvalAllocateReaders(pCsr, pCsr->pExpr, &nToken, &nOr, &rc); /* Determine which, if any, tokens in the expression should be deferred. */ - if( rc==SQLITE_OK && nToken>1 && pTab->bFts4 ){ + if( rc==SQLITE_OK && nToken>1 && pTab->bHasStat ){ Fts3TokenAndCost *aTC; Fts3Expr **apOr; aTC = (Fts3TokenAndCost *)sqlite3_malloc( sizeof(Fts3TokenAndCost) * nToken + sizeof(Fts3Expr *) * nOr * 2 @@ -121528,12 +120618,12 @@ int ii; Fts3TokenAndCost *pTC = aTC; Fts3Expr **ppOr = apOr; fts3EvalTokenCosts(pCsr, 0, pCsr->pExpr, &pTC, &ppOr, &rc); - nToken = (int)(pTC-aTC); - nOr = (int)(ppOr-apOr); + nToken = pTC-aTC; + nOr = ppOr-apOr; if( rc==SQLITE_OK ){ rc = fts3EvalSelectDeferred(pCsr, 0, aTC, nToken); for(ii=0; rc==SQLITE_OK && iidoclist.pList; res = fts3PoslistNearMerge( &pOut, aTmp, nParam1, nParam2, paPoslist, &p2 ); if( res ){ - nNew = (int)(pOut - pPhrase->doclist.pList) - 1; + nNew = (pOut - pPhrase->doclist.pList) - 1; assert( pPhrase->doclist.pList[nNew]=='\0' ); assert( nNew<=pPhrase->doclist.nList && nNew>0 ); memset(&pPhrase->doclist.pList[nNew], 0, pPhrase->doclist.nList - nNew); pPhrase->doclist.nList = nNew; *paPoslist = pPhrase->doclist.pList; @@ -122271,91 +121361,30 @@ ** 0x04 0x05 0x03 0x01 or 0x04 0x05 0x03 0x00 ** ** This function works regardless of whether or not the phrase is deferred, ** incremental, or neither. */ -SQLITE_PRIVATE int sqlite3Fts3EvalPhrasePoslist( +SQLITE_PRIVATE char *sqlite3Fts3EvalPhrasePoslist( Fts3Cursor *pCsr, /* FTS3 cursor object */ Fts3Expr *pExpr, /* Phrase to return doclist for */ - int iCol, /* Column to return position list for */ - char **ppOut /* OUT: Pointer to position list */ + int iCol /* Column to return position list for */ ){ Fts3Phrase *pPhrase = pExpr->pPhrase; Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab; - char *pIter; + char *pIter = pPhrase->doclist.pList; int iThis; - sqlite3_int64 iDocid; - /* If this phrase is applies specifically to some column other than - ** column iCol, return a NULL pointer. */ - *ppOut = 0; assert( iCol>=0 && iColnColumn ); - if( (pPhrase->iColumnnColumn && pPhrase->iColumn!=iCol) ){ - return SQLITE_OK; - } - - iDocid = pExpr->iDocid; - pIter = pPhrase->doclist.pList; - if( iDocid!=pCsr->iPrevId || pExpr->bEof ){ - int bDescDoclist = pTab->bDescIdx; /* For DOCID_CMP macro */ - int bOr = 0; - u8 bEof = 0; - Fts3Expr *p; - - /* Check if this phrase descends from an OR expression node. If not, - ** return NULL. Otherwise, the entry that corresponds to docid - ** pCsr->iPrevId may lie earlier in the doclist buffer. */ - for(p=pExpr->pParent; p; p=p->pParent){ - if( p->eType==FTSQUERY_OR ) bOr = 1; - } - if( bOr==0 ) return SQLITE_OK; - - /* This is the descendent of an OR node. In this case we cannot use - ** an incremental phrase. Load the entire doclist for the phrase - ** into memory in this case. */ - if( pPhrase->bIncr ){ - int rc = SQLITE_OK; - int bEofSave = pExpr->bEof; - fts3EvalRestart(pCsr, pExpr, &rc); - while( rc==SQLITE_OK && !pExpr->bEof ){ - fts3EvalNextRow(pCsr, pExpr, &rc); - if( bEofSave==0 && pExpr->iDocid==iDocid ) break; - } - pIter = pPhrase->doclist.pList; - assert( rc!=SQLITE_OK || pPhrase->bIncr==0 ); - if( rc!=SQLITE_OK ) return rc; - } - - if( pExpr->bEof ){ - pIter = 0; - iDocid = 0; - } - bEof = (pPhrase->doclist.nAll==0); - assert( bDescDoclist==0 || bDescDoclist==1 ); - assert( pCsr->bDesc==0 || pCsr->bDesc==1 ); - - if( pCsr->bDesc==bDescDoclist ){ - int dummy; - while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)>0 ) && bEof==0 ){ - sqlite3Fts3DoclistPrev( - bDescDoclist, pPhrase->doclist.aAll, pPhrase->doclist.nAll, - &pIter, &iDocid, &dummy, &bEof - ); - } - }else{ - while( (pIter==0 || DOCID_CMP(iDocid, pCsr->iPrevId)<0 ) && bEof==0 ){ - sqlite3Fts3DoclistNext( - bDescDoclist, pPhrase->doclist.aAll, pPhrase->doclist.nAll, - &pIter, &iDocid, &bEof - ); - } - } - - if( bEof || iDocid!=pCsr->iPrevId ) pIter = 0; - } - if( pIter==0 ) return SQLITE_OK; - + if( !pIter + || pExpr->bEof + || pExpr->iDocid!=pCsr->iPrevId + || (pPhrase->iColumnnColumn && pPhrase->iColumn!=iCol) + ){ + return 0; + } + + assert( pPhrase->doclist.nList>0 ); if( *pIter==0x01 ){ pIter++; pIter += sqlite3Fts3GetVarint32(pIter, &iThis); }else{ iThis = 0; @@ -122365,12 +121394,11 @@ if( *pIter==0x00 ) return 0; pIter++; pIter += sqlite3Fts3GetVarint32(pIter, &iThis); } - *ppOut = ((iCol==iThis)?pIter:0); - return SQLITE_OK; + return ((iCol==iThis)?pIter:0); } /* ** Free all components of the Fts3Phrase structure that were allocated by ** the eval module. Specifically, this means to free: @@ -122388,11 +121416,10 @@ fts3SegReaderCursorFree(pPhrase->aToken[i].pSegcsr); pPhrase->aToken[i].pSegcsr = 0; } } } - /* ** Return SQLITE_CORRUPT_VTAB. */ #ifdef SQLITE_DEBUG @@ -122497,13 +121524,13 @@ ); return SQLITE_ERROR; } zDb = argv[1]; - nDb = (int)strlen(zDb); + nDb = strlen(zDb); zFts3 = argv[3]; - nFts3 = (int)strlen(zFts3); + nFts3 = strlen(zFts3); rc = sqlite3_declare_vtab(db, FTS3_TERMS_SCHEMA); if( rc!=SQLITE_OK ) return rc; nByte = sizeof(Fts3auxTable) + sizeof(Fts3Table) + nDb + nFts3 + 2; @@ -122794,11 +121821,11 @@ pCsr->zStop = sqlite3_mprintf("%s", sqlite3_value_text(apVal[iIdx])); pCsr->nStop = sqlite3_value_bytes(apVal[iIdx]); if( pCsr->zStop==0 ) return SQLITE_NOMEM; } - rc = sqlite3Fts3SegReaderCursor(pFts3, 0, 0, FTS3_SEGCURSOR_ALL, + rc = sqlite3Fts3SegReaderCursor(pFts3, 0, FTS3_SEGCURSOR_ALL, pCsr->filter.zTerm, pCsr->filter.nTerm, 0, isScan, &pCsr->csr ); if( rc==SQLITE_OK ){ rc = sqlite3Fts3SegReaderStart(pFts3, &pCsr->csr, &pCsr->filter); } @@ -122986,11 +122013,10 @@ ** zero. */ typedef struct ParseContext ParseContext; struct ParseContext { sqlite3_tokenizer *pTokenizer; /* Tokenizer module */ - int iLangid; /* Language id used with tokenizer */ const char **azCol; /* Array of column names for fts3 table */ int bFts4; /* True to allow FTS4-only syntax */ int nCol; /* Number of entries in azCol[] */ int iDefaultCol; /* Default column to query */ int isNot; /* True if getNextNode() sees a unary - */ @@ -123022,37 +122048,10 @@ void *pRet = sqlite3_malloc(nByte); if( pRet ) memset(pRet, 0, nByte); return pRet; } -SQLITE_PRIVATE int sqlite3Fts3OpenTokenizer( - sqlite3_tokenizer *pTokenizer, - int iLangid, - const char *z, - int n, - sqlite3_tokenizer_cursor **ppCsr -){ - sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; - sqlite3_tokenizer_cursor *pCsr = 0; - int rc; - - rc = pModule->xOpen(pTokenizer, z, n, &pCsr); - assert( rc==SQLITE_OK || pCsr==0 ); - if( rc==SQLITE_OK ){ - pCsr->pTokenizer = pTokenizer; - if( pModule->iVersion>=1 ){ - rc = pModule->xLanguageid(pCsr, iLangid); - if( rc!=SQLITE_OK ){ - pModule->xClose(pCsr); - pCsr = 0; - } - } - } - *ppCsr = pCsr; - return rc; -} - /* ** Extract the next token from buffer z (length n) using the tokenizer ** and other information (column names etc.) in pParse. Create an Fts3Expr ** structure of type FTSQUERY_PHRASE containing a phrase consisting of this @@ -123076,17 +122075,19 @@ int rc; sqlite3_tokenizer_cursor *pCursor; Fts3Expr *pRet = 0; int nConsumed = 0; - rc = sqlite3Fts3OpenTokenizer(pTokenizer, pParse->iLangid, z, n, &pCursor); + rc = pModule->xOpen(pTokenizer, z, n, &pCursor); if( rc==SQLITE_OK ){ const char *zToken; int nToken, iStart, iEnd, iPosition; int nByte; /* total space to allocate */ + pCursor->pTokenizer = pTokenizer; rc = pModule->xNext(pCursor, &zToken, &nToken, &iStart, &iEnd, &iPosition); + if( rc==SQLITE_OK ){ nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken; pRet = (Fts3Expr *)fts3MallocZero(nByte); if( !pRet ){ rc = SQLITE_NOMEM; @@ -123188,14 +122189,14 @@ ** ** The second pass, in the block that begins "if( rc==SQLITE_DONE )" below, ** appends buffer zTemp to buffer p, and fills in the Fts3Expr and Fts3Phrase ** structures. */ - rc = sqlite3Fts3OpenTokenizer( - pTokenizer, pParse->iLangid, zInput, nInput, &pCursor); + rc = pModule->xOpen(pTokenizer, zInput, nInput, &pCursor); if( rc==SQLITE_OK ){ int ii; + pCursor->pTokenizer = pTokenizer; for(ii=0; rc==SQLITE_OK; ii++){ const char *zByte; int nByte, iBegin, iEnd, iPos; rc = pModule->xNext(pCursor, &zByte, &nByte, &iBegin, &iEnd, &iPos); if( rc==SQLITE_OK ){ @@ -123665,11 +122666,10 @@ ** specified as part of the query string), or -1 if tokens may by default ** match any table column. */ SQLITE_PRIVATE int sqlite3Fts3ExprParse( sqlite3_tokenizer *pTokenizer, /* Tokenizer module */ - int iLangid, /* Language id for tokenizer */ char **azCol, /* Array of column names for fts3 table */ int bFts4, /* True to allow FTS4-only syntax */ int nCol, /* Number of entries in azCol[] */ int iDefaultCol, /* Default column to query */ const char *z, int n, /* Text of MATCH query */ @@ -123676,17 +122676,15 @@ Fts3Expr **ppExpr /* OUT: Parsed query structure */ ){ int nParsed; int rc; ParseContext sParse; - - memset(&sParse, 0, sizeof(ParseContext)); sParse.pTokenizer = pTokenizer; - sParse.iLangid = iLangid; sParse.azCol = (const char **)azCol; sParse.nCol = nCol; sParse.iDefaultCol = iDefaultCol; + sParse.nNest = 0; sParse.bFts4 = bFts4; if( z==0 ){ *ppExpr = 0; return SQLITE_OK; } @@ -123873,11 +122871,11 @@ for(ii=0; iixCreate(zArg ? 1 : 0, &zArg, &pTokenizer) ){ zErr = "error in xCreate()"; goto finish; } pTokenizer->pModule = p; - if( sqlite3Fts3OpenTokenizer(pTokenizer, 0, zInput, nInput, &pCsr) ){ + if( SQLITE_OK!=p->xOpen(pTokenizer, zInput, nInput, &pCsr) ){ zErr = "error in xOpen()"; goto finish; } + pCsr->pTokenizer = pTokenizer; while( SQLITE_OK==p->xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos) ){ Tcl_ListObjAppendElement(0, pRet, Tcl_NewIntObj(iPos)); Tcl_ListObjAppendElement(0, pRet, Tcl_NewStringObj(zToken, nToken)); zToken = &zInput[iStart]; @@ -125647,11 +124645,10 @@ simpleCreate, simpleDestroy, simpleOpen, simpleClose, simpleNext, - 0, }; /* ** Allocate a new simple tokenizer. Return a pointer to the new ** tokenizer in *ppModule @@ -125689,13 +124686,10 @@ /* #include */ /* #include */ /* #include */ - -#define FTS_MAX_APPENDABLE_HEIGHT 16 - /* ** When full-text index nodes are loaded from disk, the buffer that they ** are loaded into has the following number of bytes of padding at the end ** of it. i.e. if a full-text index node is 900 bytes in size, then a buffer ** of 920 bytes is allocated for it. @@ -125730,33 +124724,10 @@ # define FTS3_NODE_CHUNK_THRESHOLD test_fts3_node_chunk_threshold #else # define FTS3_NODE_CHUNKSIZE (4*1024) # define FTS3_NODE_CHUNK_THRESHOLD (FTS3_NODE_CHUNKSIZE*4) #endif - -/* -** The two values that may be meaningfully bound to the :1 parameter in -** statements SQL_REPLACE_STAT and SQL_SELECT_STAT. -*/ -#define FTS_STAT_DOCTOTAL 0 -#define FTS_STAT_INCRMERGEHINT 1 -#define FTS_STAT_AUTOINCRMERGE 2 - -/* -** If FTS_LOG_MERGES is defined, call sqlite3_log() to report each automatic -** and incremental merge operation that takes place. This is used for -** debugging FTS only, it should not usually be turned on in production -** systems. -*/ -#ifdef FTS3_LOG_MERGES -static void fts3LogMerge(int nMerge, sqlite3_int64 iAbsLevel){ - sqlite3_log(SQLITE_OK, "%d-way merge from level %d", nMerge, (int)iAbsLevel); -} -#else -#define fts3LogMerge(x, y) -#endif - typedef struct PendingList PendingList; typedef struct SegmentNode SegmentNode; typedef struct SegmentWriter SegmentWriter; @@ -125801,11 +124772,10 @@ ** fts3SegReaderFirstDocid() ** fts3SegReaderNextDocid() */ struct Fts3SegReader { int iIdx; /* Index within level, or 0x7FFFFFFF for PT */ - int bLookup; /* True for a lookup only */ sqlite3_int64 iStartBlock; /* Rowid of first leaf block to traverse */ sqlite3_int64 iLeafEndBlock; /* Rowid of final leaf block to traverse */ sqlite3_int64 iEndBlock; /* Rowid of final block in segment (or 0) */ sqlite3_int64 iCurrentBlock; /* Current leaf block (or 0) */ @@ -125915,26 +124885,17 @@ #define SQL_DELETE_SEGMENTS_RANGE 17 #define SQL_CONTENT_INSERT 18 #define SQL_DELETE_DOCSIZE 19 #define SQL_REPLACE_DOCSIZE 20 #define SQL_SELECT_DOCSIZE 21 -#define SQL_SELECT_STAT 22 -#define SQL_REPLACE_STAT 23 +#define SQL_SELECT_DOCTOTAL 22 +#define SQL_REPLACE_DOCTOTAL 23 #define SQL_SELECT_ALL_PREFIX_LEVEL 24 #define SQL_DELETE_ALL_TERMS_SEGDIR 25 + #define SQL_DELETE_SEGDIR_RANGE 26 -#define SQL_SELECT_ALL_LANGID 27 -#define SQL_FIND_MERGE_LEVEL 28 -#define SQL_MAX_LEAF_NODE_ESTIMATE 29 -#define SQL_DELETE_SEGDIR_ENTRY 30 -#define SQL_SHIFT_SEGDIR_ENTRY 31 -#define SQL_SELECT_SEGDIR 32 -#define SQL_CHOMP_SEGDIR 33 -#define SQL_SEGMENT_IS_APPENDABLE 34 -#define SQL_SELECT_INDEXES 35 -#define SQL_SELECT_MXLEVEL 36 /* ** This function is used to obtain an SQLite prepared statement handle ** for the statement identified by the second argument. If successful, ** *pp is set to the requested statement handle and SQLITE_OK returned. @@ -125959,13 +124920,13 @@ /* 4 */ "DELETE FROM %Q.'%q_segdir'", /* 5 */ "DELETE FROM %Q.'%q_docsize'", /* 6 */ "DELETE FROM %Q.'%q_stat'", /* 7 */ "SELECT %s WHERE rowid=?", /* 8 */ "SELECT (SELECT max(idx) FROM %Q.'%q_segdir' WHERE level = ?) + 1", -/* 9 */ "REPLACE INTO %Q.'%q_segments'(blockid, block) VALUES(?, ?)", +/* 9 */ "INSERT INTO %Q.'%q_segments'(blockid, block) VALUES(?, ?)", /* 10 */ "SELECT coalesce((SELECT max(blockid) FROM %Q.'%q_segments') + 1, 1)", -/* 11 */ "REPLACE INTO %Q.'%q_segdir' VALUES(?,?,?,?,?,?)", +/* 11 */ "INSERT INTO %Q.'%q_segdir' VALUES(?,?,?,?,?,?)", /* Return segments in order from oldest to newest.*/ /* 12 */ "SELECT idx, start_block, leaves_end_block, end_block, root " "FROM %Q.'%q_segdir' WHERE level = ? ORDER BY idx ASC", /* 13 */ "SELECT idx, start_block, leaves_end_block, end_block, root " @@ -125979,65 +124940,17 @@ /* 17 */ "DELETE FROM %Q.'%q_segments' WHERE blockid BETWEEN ? AND ?", /* 18 */ "INSERT INTO %Q.'%q_content' VALUES(%s)", /* 19 */ "DELETE FROM %Q.'%q_docsize' WHERE docid = ?", /* 20 */ "REPLACE INTO %Q.'%q_docsize' VALUES(?,?)", /* 21 */ "SELECT size FROM %Q.'%q_docsize' WHERE docid=?", -/* 22 */ "SELECT value FROM %Q.'%q_stat' WHERE id=?", -/* 23 */ "REPLACE INTO %Q.'%q_stat' VALUES(?,?)", +/* 22 */ "SELECT value FROM %Q.'%q_stat' WHERE id=0", +/* 23 */ "REPLACE INTO %Q.'%q_stat' VALUES(0,?)", /* 24 */ "", /* 25 */ "", /* 26 */ "DELETE FROM %Q.'%q_segdir' WHERE level BETWEEN ? AND ?", -/* 27 */ "SELECT DISTINCT level / (1024 * ?) FROM %Q.'%q_segdir'", - -/* This statement is used to determine which level to read the input from -** when performing an incremental merge. It returns the absolute level number -** of the oldest level in the db that contains at least ? segments. Or, -** if no level in the FTS index contains more than ? segments, the statement -** returns zero rows. */ -/* 28 */ "SELECT level FROM %Q.'%q_segdir' GROUP BY level HAVING count(*)>=?" - " ORDER BY (level %% 1024) ASC LIMIT 1", - -/* Estimate the upper limit on the number of leaf nodes in a new segment -** created by merging the oldest :2 segments from absolute level :1. See -** function sqlite3Fts3Incrmerge() for details. */ -/* 29 */ "SELECT 2 * total(1 + leaves_end_block - start_block) " - " FROM %Q.'%q_segdir' WHERE level = ? AND idx < ?", - -/* SQL_DELETE_SEGDIR_ENTRY -** Delete the %_segdir entry on absolute level :1 with index :2. */ -/* 30 */ "DELETE FROM %Q.'%q_segdir' WHERE level = ? AND idx = ?", - -/* SQL_SHIFT_SEGDIR_ENTRY -** Modify the idx value for the segment with idx=:3 on absolute level :2 -** to :1. */ -/* 31 */ "UPDATE %Q.'%q_segdir' SET idx = ? WHERE level=? AND idx=?", - -/* SQL_SELECT_SEGDIR -** Read a single entry from the %_segdir table. The entry from absolute -** level :1 with index value :2. */ -/* 32 */ "SELECT idx, start_block, leaves_end_block, end_block, root " - "FROM %Q.'%q_segdir' WHERE level = ? AND idx = ?", - -/* SQL_CHOMP_SEGDIR -** Update the start_block (:1) and root (:2) fields of the %_segdir -** entry located on absolute level :3 with index :4. */ -/* 33 */ "UPDATE %Q.'%q_segdir' SET start_block = ?, root = ?" - "WHERE level = ? AND idx = ?", - -/* SQL_SEGMENT_IS_APPENDABLE -** Return a single row if the segment with end_block=? is appendable. Or -** no rows otherwise. */ -/* 34 */ "SELECT 1 FROM %Q.'%q_segments' WHERE blockid=? AND block IS NULL", - -/* SQL_SELECT_INDEXES -** Return the list of valid segment indexes for absolute level ? */ -/* 35 */ "SELECT idx FROM %Q.'%q_segdir' WHERE level=? ORDER BY 1 ASC", - -/* SQL_SELECT_MXLEVEL -** Return the largest relative level in the FTS index or indexes. */ -/* 36 */ "SELECT max( level %% 1024 ) FROM %Q.'%q_segdir'" + }; int rc = SQLITE_OK; sqlite3_stmt *pStmt; assert( SizeofArray(azSql)==SizeofArray(p->aStmt) ); @@ -126071,22 +124984,26 @@ } *pp = pStmt; return rc; } - static int fts3SelectDocsize( Fts3Table *pTab, /* FTS3 table handle */ + int eStmt, /* Either SQL_SELECT_DOCSIZE or DOCTOTAL */ sqlite3_int64 iDocid, /* Docid to bind for SQL_SELECT_DOCSIZE */ sqlite3_stmt **ppStmt /* OUT: Statement handle */ ){ sqlite3_stmt *pStmt = 0; /* Statement requested from fts3SqlStmt() */ int rc; /* Return code */ - rc = fts3SqlStmt(pTab, SQL_SELECT_DOCSIZE, &pStmt, 0); + assert( eStmt==SQL_SELECT_DOCSIZE || eStmt==SQL_SELECT_DOCTOTAL ); + + rc = fts3SqlStmt(pTab, eStmt, &pStmt, 0); if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pStmt, 1, iDocid); + if( eStmt==SQL_SELECT_DOCSIZE ){ + sqlite3_bind_int64(pStmt, 1, iDocid); + } rc = sqlite3_step(pStmt); if( rc!=SQLITE_ROW || sqlite3_column_type(pStmt, 0)!=SQLITE_BLOB ){ rc = sqlite3_reset(pStmt); if( rc==SQLITE_OK ) rc = FTS_CORRUPT_VTAB; pStmt = 0; @@ -126101,33 +125018,19 @@ SQLITE_PRIVATE int sqlite3Fts3SelectDoctotal( Fts3Table *pTab, /* Fts3 table handle */ sqlite3_stmt **ppStmt /* OUT: Statement handle */ ){ - sqlite3_stmt *pStmt = 0; - int rc; - rc = fts3SqlStmt(pTab, SQL_SELECT_STAT, &pStmt, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int(pStmt, 1, FTS_STAT_DOCTOTAL); - if( sqlite3_step(pStmt)!=SQLITE_ROW - || sqlite3_column_type(pStmt, 0)!=SQLITE_BLOB - ){ - rc = sqlite3_reset(pStmt); - if( rc==SQLITE_OK ) rc = FTS_CORRUPT_VTAB; - pStmt = 0; - } - } - *ppStmt = pStmt; - return rc; + return fts3SelectDocsize(pTab, SQL_SELECT_DOCTOTAL, 0, ppStmt); } SQLITE_PRIVATE int sqlite3Fts3SelectDocsize( Fts3Table *pTab, /* Fts3 table handle */ sqlite3_int64 iDocid, /* Docid to read size data for */ sqlite3_stmt **ppStmt /* OUT: Statement handle */ ){ - return fts3SelectDocsize(pTab, iDocid, ppStmt); + return fts3SelectDocsize(pTab, SQL_SELECT_DOCSIZE, iDocid, ppStmt); } /* ** Similar to fts3SqlStmt(). Except, after binding the parameters in ** array apVal[] to the SQL statement identified by eStmt, the statement @@ -126189,48 +125092,10 @@ } return rc; } -/* -** FTS maintains a separate indexes for each language-id (a 32-bit integer). -** Within each language id, a separate index is maintained to store the -** document terms, and each configured prefix size (configured the FTS -** "prefix=" option). And each index consists of multiple levels ("relative -** levels"). -** -** All three of these values (the language id, the specific index and the -** level within the index) are encoded in 64-bit integer values stored -** in the %_segdir table on disk. This function is used to convert three -** separate component values into the single 64-bit integer value that -** can be used to query the %_segdir table. -** -** Specifically, each language-id/index combination is allocated 1024 -** 64-bit integer level values ("absolute levels"). The main terms index -** for language-id 0 is allocate values 0-1023. The first prefix index -** (if any) for language-id 0 is allocated values 1024-2047. And so on. -** Language 1 indexes are allocated immediately following language 0. -** -** So, for a system with nPrefix prefix indexes configured, the block of -** absolute levels that corresponds to language-id iLangid and index -** iIndex starts at absolute level ((iLangid * (nPrefix+1) + iIndex) * 1024). -*/ -static sqlite3_int64 getAbsoluteLevel( - Fts3Table *p, /* FTS3 table handle */ - int iLangid, /* Language id */ - int iIndex, /* Index in p->aIndex[] */ - int iLevel /* Level of segments */ -){ - sqlite3_int64 iBase; /* First absolute level for iLangid/iIndex */ - assert( iLangid>=0 ); - assert( p->nIndex>0 ); - assert( iIndex>=0 && iIndexnIndex ); - - iBase = ((sqlite3_int64)iLangid * p->nIndex + iIndex) * FTS3_SEGDIR_MAXLEVEL; - return iBase + iLevel; -} - /* ** Set *ppStmt to a statement handle that may be used to iterate through ** all rows in the %_segdir table, from oldest to newest. If successful, ** return SQLITE_OK. If an error occurs while preparing the statement, ** return an SQLite error code. @@ -126246,13 +125111,12 @@ ** 3: end_block ** 4: root */ SQLITE_PRIVATE int sqlite3Fts3AllSegdirs( Fts3Table *p, /* FTS3 table */ - int iLangid, /* Language being queried */ int iIndex, /* Index for p->aIndex[] */ - int iLevel, /* Level to select (relative level) */ + int iLevel, /* Level to select */ sqlite3_stmt **ppStmt /* OUT: Compiled statement */ ){ int rc; sqlite3_stmt *pStmt = 0; @@ -126262,20 +125126,18 @@ if( iLevel<0 ){ /* "SELECT * FROM %_segdir WHERE level BETWEEN ? AND ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL_RANGE, &pStmt, 0); if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); - sqlite3_bind_int64(pStmt, 2, - getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) - ); + sqlite3_bind_int(pStmt, 1, iIndex*FTS3_SEGDIR_MAXLEVEL); + sqlite3_bind_int(pStmt, 2, (iIndex+1)*FTS3_SEGDIR_MAXLEVEL-1); } }else{ /* "SELECT * FROM %_segdir WHERE level = ? ORDER BY ..." */ rc = fts3SqlStmt(p, SQL_SELECT_LEVEL, &pStmt, 0); if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex,iLevel)); + sqlite3_bind_int(pStmt, 1, iLevel+iIndex*FTS3_SEGDIR_MAXLEVEL); } } *ppStmt = pStmt; return rc; } @@ -126437,11 +125299,10 @@ ** ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code. */ static int fts3PendingTermsAdd( Fts3Table *p, /* Table into which text will be inserted */ - int iLangid, /* Language id to use */ const char *zText, /* Text of document to be inserted */ int iCol, /* Column into which text is being inserted */ u32 *pnWord /* OUT: Number of tokens inserted */ ){ int rc; @@ -126467,14 +125328,15 @@ if( zText==0 ){ *pnWord = 0; return SQLITE_OK; } - rc = sqlite3Fts3OpenTokenizer(pTokenizer, iLangid, zText, -1, &pCsr); + rc = pModule->xOpen(pTokenizer, zText, -1, &pCsr); if( rc!=SQLITE_OK ){ return rc; } + pCsr->pTokenizer = pTokenizer; xNext = pModule->xNext; while( SQLITE_OK==rc && SQLITE_OK==(rc = xNext(pCsr, &zToken, &nToken, &iStart, &iEnd, &iPos)) ){ @@ -126513,32 +125375,22 @@ /* ** Calling this function indicates that subsequent calls to ** fts3PendingTermsAdd() are to add term/position-list pairs for the ** contents of the document with docid iDocid. */ -static int fts3PendingTermsDocid( - Fts3Table *p, /* Full-text table handle */ - int iLangid, /* Language id of row being written */ - sqlite_int64 iDocid /* Docid of row being written */ -){ - assert( iLangid>=0 ); - +static int fts3PendingTermsDocid(Fts3Table *p, sqlite_int64 iDocid){ /* TODO(shess) Explore whether partially flushing the buffer on ** forced-flush would provide better performance. I suspect that if ** we ordered the doclists by size and flushed the largest until the ** buffer was half empty, that would let the less frequent terms ** generate longer doclists. */ - if( iDocid<=p->iPrevDocid - || p->iPrevLangid!=iLangid - || p->nPendingData>p->nMaxPendingData - ){ + if( iDocid<=p->iPrevDocid || p->nPendingData>p->nMaxPendingData ){ int rc = sqlite3Fts3PendingTermsFlush(p); if( rc!=SQLITE_OK ) return rc; } p->iPrevDocid = iDocid; - p->iPrevLangid = iLangid; return SQLITE_OK; } /* ** Discard the contents of the pending-terms hash tables. @@ -126563,20 +125415,15 @@ ** pendingTerms hash table. ** ** Argument apVal is the same as the similarly named argument passed to ** fts3InsertData(). Parameter iDocid is the docid of the new row. */ -static int fts3InsertTerms( - Fts3Table *p, - int iLangid, - sqlite3_value **apVal, - u32 *aSz -){ +static int fts3InsertTerms(Fts3Table *p, sqlite3_value **apVal, u32 *aSz){ int i; /* Iterator variable */ for(i=2; inColumn+2; i++){ const char *zText = (const char *)sqlite3_value_text(apVal[i]); - int rc = fts3PendingTermsAdd(p, iLangid, zText, i-2, &aSz[i-2]); + int rc = fts3PendingTermsAdd(p, zText, i-2, &aSz[i-2]); if( rc!=SQLITE_OK ){ return rc; } aSz[p->nColumn] += sqlite3_value_bytes(apVal[i]); } @@ -126593,11 +125440,10 @@ ** apVal[2] Left-most user-defined column ** ... ** apVal[p->nColumn+1] Right-most user-defined column ** apVal[p->nColumn+2] Hidden column with same name as table ** apVal[p->nColumn+3] Hidden "docid" column (alias for rowid) -** apVal[p->nColumn+4] Hidden languageid column */ static int fts3InsertData( Fts3Table *p, /* Full-text table */ sqlite3_value **apVal, /* Array of values to insert */ sqlite3_int64 *piDocid /* OUT: Docid for row just inserted */ @@ -126624,17 +125470,13 @@ ** ** The statement features N '?' variables, where N is the number of user ** defined columns in the FTS3 table, plus one for the docid field. */ rc = fts3SqlStmt(p, SQL_CONTENT_INSERT, &pContentInsert, &apVal[1]); - if( rc==SQLITE_OK && p->zLanguageid ){ - rc = sqlite3_bind_int( - pContentInsert, p->nColumn+2, - sqlite3_value_int(apVal[p->nColumn+4]) - ); + if( rc!=SQLITE_OK ){ + return rc; } - if( rc!=SQLITE_OK ) return rc; /* There is a quirk here. The users INSERT statement may have specified ** a value for the "rowid" field, for the "docid" field, or for both. ** Which is a problem, since "rowid" and "docid" are aliases for the ** same value. For example: @@ -126690,19 +125532,10 @@ fts3SqlExec(&rc, p, SQL_DELETE_ALL_STAT, 0); } return rc; } -/* -** -*/ -static int langidFromSelect(Fts3Table *p, sqlite3_stmt *pSelect){ - int iLangid = 0; - if( p->zLanguageid ) iLangid = sqlite3_column_int(pSelect, p->nColumn+1); - return iLangid; -} - /* ** The first element in the apVal[] array is assumed to contain the docid ** (an integer) of a row about to be deleted. Remove all terms from the ** full-text index. */ @@ -126718,22 +125551,20 @@ if( *pRC ) return; rc = fts3SqlStmt(p, SQL_SELECT_CONTENT_BY_ROWID, &pSelect, &pRowid); if( rc==SQLITE_OK ){ if( SQLITE_ROW==sqlite3_step(pSelect) ){ int i; - int iLangid = langidFromSelect(p, pSelect); - rc = fts3PendingTermsDocid(p, iLangid, sqlite3_column_int64(pSelect, 0)); - for(i=1; rc==SQLITE_OK && i<=p->nColumn; i++){ + for(i=1; i<=p->nColumn; i++){ const char *zText = (const char *)sqlite3_column_text(pSelect, i); - rc = fts3PendingTermsAdd(p, iLangid, zText, -1, &aSz[i-1]); + rc = fts3PendingTermsAdd(p, zText, -1, &aSz[i-1]); + if( rc!=SQLITE_OK ){ + sqlite3_reset(pSelect); + *pRC = rc; + return; + } aSz[p->nColumn] += sqlite3_column_bytes(pSelect, i); } - if( rc!=SQLITE_OK ){ - sqlite3_reset(pSelect); - *pRC = rc; - return; - } } rc = sqlite3_reset(pSelect); }else{ sqlite3_reset(pSelect); } @@ -126742,11 +125573,11 @@ /* ** Forward declaration to account for the circular dependency between ** functions fts3SegmentMerge() and fts3AllocateSegdirIdx(). */ -static int fts3SegmentMerge(Fts3Table *, int, int, int); +static int fts3SegmentMerge(Fts3Table *, int, int); /* ** This function allocates a new level iLevel index in the segdir table. ** Usually, indexes are allocated within a level sequentially starting ** with 0, so the allocated index is one greater than the value returned @@ -126761,28 +125592,22 @@ ** If successful, *piIdx is set to the allocated index slot and SQLITE_OK ** returned. Otherwise, an SQLite error code is returned. */ static int fts3AllocateSegdirIdx( Fts3Table *p, - int iLangid, /* Language id */ int iIndex, /* Index for p->aIndex */ int iLevel, int *piIdx ){ int rc; /* Return Code */ sqlite3_stmt *pNextIdx; /* Query for next idx at level iLevel */ int iNext = 0; /* Result of query pNextIdx */ - assert( iLangid>=0 ); - assert( p->nIndex>=1 ); - /* Set variable iNext to the next available segdir index at level iLevel. */ rc = fts3SqlStmt(p, SQL_NEXT_SEGMENT_INDEX, &pNextIdx, 0); if( rc==SQLITE_OK ){ - sqlite3_bind_int64( - pNextIdx, 1, getAbsoluteLevel(p, iLangid, iIndex, iLevel) - ); + sqlite3_bind_int(pNextIdx, 1, iIndex*FTS3_SEGDIR_MAXLEVEL + iLevel); if( SQLITE_ROW==sqlite3_step(pNextIdx) ){ iNext = sqlite3_column_int(pNextIdx, 0); } rc = sqlite3_reset(pNextIdx); } @@ -126792,12 +125617,11 @@ ** full, merge all segments in level iLevel into a single iLevel+1 ** segment and allocate (newly freed) index 0 at level iLevel. Otherwise, ** if iNext is less than FTS3_MERGE_COUNT, allocate index iNext. */ if( iNext>=FTS3_MERGE_COUNT ){ - fts3LogMerge(16, getAbsoluteLevel(p, iLangid, iIndex, iLevel)); - rc = fts3SegmentMerge(p, iLangid, iIndex, iLevel); + rc = fts3SegmentMerge(p, iIndex, iLevel); *piIdx = 0; }else{ *piIdx = iNext; } } @@ -126840,11 +125664,11 @@ int *pnLoad /* OUT: Bytes actually loaded */ ){ int rc; /* Return code */ /* pnBlob must be non-NULL. paBlob may be NULL or non-NULL. */ - assert( pnBlob ); + assert( pnBlob); if( p->pSegments ){ rc = sqlite3_blob_reopen(p->pSegments, iBlockid); }else{ if( 0==p->zSegmentsTbl ){ @@ -126926,22 +125750,10 @@ rc = fts3SegReaderIncrRead(pReader); } return rc; } -/* -** Set an Fts3SegReader cursor to point at EOF. -*/ -static void fts3SegReaderSetEof(Fts3SegReader *pSeg){ - if( !fts3SegReaderIsRootOnly(pSeg) ){ - sqlite3_free(pSeg->aNode); - sqlite3_blob_close(pSeg->pBlob); - pSeg->pBlob = 0; - } - pSeg->aNode = 0; -} - /* ** Move the iterator passed as the first argument to the next term in the ** segment. If successful, SQLITE_OK is returned. If there is no next term, ** SQLITE_DONE. Otherwise, an SQLite error code. */ @@ -126977,11 +125789,16 @@ assert( pReader->aNode ); } return SQLITE_OK; } - fts3SegReaderSetEof(pReader); + if( !fts3SegReaderIsRootOnly(pReader) ){ + sqlite3_free(pReader->aNode); + sqlite3_blob_close(pReader->pBlob); + pReader->pBlob = 0; + } + pReader->aNode = 0; /* If iCurrentBlock>=iLeafEndBlock, this is an EOF condition. All leaf ** blocks have already been traversed. */ assert( pReader->iCurrentBlock<=pReader->iLeafEndBlock ); if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){ @@ -127181,11 +125998,11 @@ int nOvfl = 0; int ii; int rc = SQLITE_OK; int pgsz = p->nPgsz; - assert( p->bFts4 ); + assert( p->bHasStat ); assert( pgsz>0 ); for(ii=0; rc==SQLITE_OK && iinSegment; ii++){ Fts3SegReader *pReader = pMsr->apSegment[ii]; if( !fts3SegReaderIsPending(pReader) @@ -127224,11 +126041,10 @@ /* ** Allocate a new SegReader object. */ SQLITE_PRIVATE int sqlite3Fts3SegReaderNew( int iAge, /* Segment "age". */ - int bLookup, /* True for a lookup only */ sqlite3_int64 iStartLeaf, /* First leaf to traverse */ sqlite3_int64 iEndLeaf, /* Final leaf to traverse */ sqlite3_int64 iEndBlock, /* Final block of segment */ const char *zRoot, /* Buffer containing root node */ int nRoot, /* Size of buffer containing root node */ @@ -127246,11 +126062,10 @@ if( !pReader ){ return SQLITE_NOMEM; } memset(pReader, 0, sizeof(Fts3SegReader)); pReader->iIdx = iAge; - pReader->bLookup = bLookup; pReader->iStartBlock = iStartLeaf; pReader->iLeafEndBlock = iEndLeaf; pReader->iEndBlock = iEndBlock; if( nExtra ){ @@ -127539,37 +126354,16 @@ rc = sqlite3_reset(pStmt); } return rc; } -/* -** Find the largest relative level number in the table. If successful, set -** *pnMax to this value and return SQLITE_OK. Otherwise, if an error occurs, -** set *pnMax to zero and return an SQLite error code. -*/ -SQLITE_PRIVATE int sqlite3Fts3MaxLevel(Fts3Table *p, int *pnMax){ - int rc; - int mxLevel = 0; - sqlite3_stmt *pStmt = 0; - - rc = fts3SqlStmt(p, SQL_SELECT_MXLEVEL, &pStmt, 0); - if( rc==SQLITE_OK ){ - if( SQLITE_ROW==sqlite3_step(pStmt) ){ - mxLevel = sqlite3_column_int(pStmt, 0); - } - rc = sqlite3_reset(pStmt); - } - *pnMax = mxLevel; - return rc; -} - /* ** Insert a record into the %_segdir table. */ static int fts3WriteSegdir( Fts3Table *p, /* Virtual table handle */ - sqlite3_int64 iLevel, /* Value for "level" field (absolute level) */ + int iLevel, /* Value for "level" field */ int iIdx, /* Value for "idx" field */ sqlite3_int64 iStartBlock, /* Value for "start_block" field */ sqlite3_int64 iLeafEndBlock, /* Value for "leaves_end_block" field */ sqlite3_int64 iEndBlock, /* Value for "end_block" field */ char *zRoot, /* Blob value for "root" field */ @@ -127576,11 +126370,11 @@ int nRoot /* Number of bytes in buffer zRoot */ ){ sqlite3_stmt *pStmt; int rc = fts3SqlStmt(p, SQL_INSERT_SEGDIR, &pStmt, 0); if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pStmt, 1, iLevel); + sqlite3_bind_int(pStmt, 1, iLevel); sqlite3_bind_int(pStmt, 2, iIdx); sqlite3_bind_int64(pStmt, 3, iStartBlock); sqlite3_bind_int64(pStmt, 4, iLeafEndBlock); sqlite3_bind_int64(pStmt, 5, iEndBlock); sqlite3_bind_blob(pStmt, 6, zRoot, nRoot, SQLITE_STATIC); @@ -127876,11 +126670,10 @@ int rc; /* The current leaf node is full. Write it out to the database. */ rc = fts3WriteSegment(p, pWriter->iFree++, pWriter->aData, nData); if( rc!=SQLITE_OK ) return rc; - p->nLeafAdd++; /* Add the current term to the interior node tree. The term added to ** the interior tree must: ** ** a) be greater than the largest term on the leaf node just written @@ -127960,11 +126753,11 @@ ** returned. Otherwise, an SQLite error code. */ static int fts3SegWriterFlush( Fts3Table *p, /* Virtual table handle */ SegmentWriter *pWriter, /* SegmentWriter to flush to the db */ - sqlite3_int64 iLevel, /* Value for 'level' column of %_segdir */ + int iLevel, /* Value for 'level' column of %_segdir */ int iIdx /* Value for 'idx' column of %_segdir */ ){ int rc; /* Return code */ if( pWriter->pTree ){ sqlite3_int64 iLast = 0; /* Largest block id written to database */ @@ -127985,11 +126778,10 @@ }else{ /* The entire tree fits on the root node. Write it to the segdir table. */ rc = fts3WriteSegdir( p, iLevel, iIdx, 0, 0, 0, pWriter->aData, pWriter->nData); } - p->nLeafAdd++; return rc; } /* ** Release all memory held by the SegmentWriter object passed as the @@ -128039,16 +126831,11 @@ ** ** Segment levels are stored in the 'level' column of the %_segdir table. ** ** Return SQLITE_OK if successful, or an SQLite error code if not. */ -static int fts3SegmentMaxLevel( - Fts3Table *p, - int iLangid, - int iIndex, - sqlite3_int64 *pnMax -){ +static int fts3SegmentMaxLevel(Fts3Table *p, int iIndex, int *pnMax){ sqlite3_stmt *pStmt; int rc; assert( iIndex>=0 && iIndexnIndex ); /* Set pStmt to the compiled version of: @@ -128057,43 +126844,18 @@ ** ** (1024 is actually the value of macro FTS3_SEGDIR_PREFIXLEVEL_STR). */ rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR_MAX_LEVEL, &pStmt, 0); if( rc!=SQLITE_OK ) return rc; - sqlite3_bind_int64(pStmt, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); - sqlite3_bind_int64(pStmt, 2, - getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) - ); + sqlite3_bind_int(pStmt, 1, iIndex*FTS3_SEGDIR_MAXLEVEL); + sqlite3_bind_int(pStmt, 2, (iIndex+1)*FTS3_SEGDIR_MAXLEVEL - 1); if( SQLITE_ROW==sqlite3_step(pStmt) ){ - *pnMax = sqlite3_column_int64(pStmt, 0); + *pnMax = sqlite3_column_int(pStmt, 0); } return sqlite3_reset(pStmt); } -/* -** Delete all entries in the %_segments table associated with the segment -** opened with seg-reader pSeg. This function does not affect the contents -** of the %_segdir table. -*/ -static int fts3DeleteSegment( - Fts3Table *p, /* FTS table handle */ - Fts3SegReader *pSeg /* Segment to delete */ -){ - int rc = SQLITE_OK; /* Return code */ - if( pSeg->iStartBlock ){ - sqlite3_stmt *pDelete; /* SQL statement to delete rows */ - rc = fts3SqlStmt(p, SQL_DELETE_SEGMENTS_RANGE, &pDelete, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pDelete, 1, pSeg->iStartBlock); - sqlite3_bind_int64(pDelete, 2, pSeg->iEndBlock); - sqlite3_step(pDelete); - rc = sqlite3_reset(pDelete); - } - } - return rc; -} - /* ** This function is used after merging multiple segments into a single large ** segment to delete the old, now redundant, segment b-trees. Specifically, ** it: ** @@ -128106,42 +126868,44 @@ ** ** SQLITE_OK is returned if successful, otherwise an SQLite error code. */ static int fts3DeleteSegdir( Fts3Table *p, /* Virtual table handle */ - int iLangid, /* Language id */ int iIndex, /* Index for p->aIndex */ int iLevel, /* Level of %_segdir entries to delete */ Fts3SegReader **apSegment, /* Array of SegReader objects */ int nReader /* Size of array apSegment */ ){ - int rc = SQLITE_OK; /* Return Code */ + int rc; /* Return Code */ int i; /* Iterator variable */ - sqlite3_stmt *pDelete = 0; /* SQL statement to delete rows */ + sqlite3_stmt *pDelete; /* SQL statement to delete rows */ + rc = fts3SqlStmt(p, SQL_DELETE_SEGMENTS_RANGE, &pDelete, 0); for(i=0; rc==SQLITE_OK && iiStartBlock ){ + sqlite3_bind_int64(pDelete, 1, pSegment->iStartBlock); + sqlite3_bind_int64(pDelete, 2, pSegment->iEndBlock); + sqlite3_step(pDelete); + rc = sqlite3_reset(pDelete); + } } if( rc!=SQLITE_OK ){ return rc; } assert( iLevel>=0 || iLevel==FTS3_SEGCURSOR_ALL ); if( iLevel==FTS3_SEGCURSOR_ALL ){ rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_RANGE, &pDelete, 0); if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pDelete, 1, getAbsoluteLevel(p, iLangid, iIndex, 0)); - sqlite3_bind_int64(pDelete, 2, - getAbsoluteLevel(p, iLangid, iIndex, FTS3_SEGDIR_MAXLEVEL-1) - ); + sqlite3_bind_int(pDelete, 1, iIndex*FTS3_SEGDIR_MAXLEVEL); + sqlite3_bind_int(pDelete, 2, (iIndex+1) * FTS3_SEGDIR_MAXLEVEL - 1); } }else{ rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_LEVEL, &pDelete, 0); if( rc==SQLITE_OK ){ - sqlite3_bind_int64( - pDelete, 1, getAbsoluteLevel(p, iLangid, iIndex, iLevel) - ); + sqlite3_bind_int(pDelete, 1, iIndex*FTS3_SEGDIR_MAXLEVEL + iLevel); } } if( rc==SQLITE_OK ){ sqlite3_step(pDelete); @@ -128300,20 +127064,15 @@ ** equal or greater value than the specified term. This prevents many ** unnecessary merge/sort operations for the case where single segment ** b-tree leaf nodes contain more than one term. */ for(i=0; pCsr->bRestart==0 && inSegment; i++){ - int res = 0; Fts3SegReader *pSeg = pCsr->apSegment[i]; do { int rc = fts3SegReaderNext(p, pSeg, 0); if( rc!=SQLITE_OK ) return rc; - }while( zTerm && (res = fts3SegReaderTermCmp(pSeg, zTerm, nTerm))<0 ); - - if( pSeg->bLookup && res!=0 ){ - fts3SegReaderSetEof(pSeg); - } + }while( zTerm && fts3SegReaderTermCmp(pSeg, zTerm, nTerm)<0 ); } fts3SegReaderSort(pCsr->apSegment, nSeg, nSeg, fts3SegReaderCmp); return SQLITE_OK; } @@ -128430,16 +127189,11 @@ /* Advance the first pCsr->nAdvance entries in the apSegment[] array ** forward. Then sort the list in order of current term again. */ for(i=0; inAdvance; i++){ - Fts3SegReader *pSeg = apSegment[i]; - if( pSeg->bLookup ){ - fts3SegReaderSetEof(pSeg); - }else{ - rc = fts3SegReaderNext(p, pSeg, 0); - } + rc = fts3SegReaderNext(p, apSegment[i], 0); if( rc!=SQLITE_OK ) return rc; } fts3SegReaderSort(apSegment, nSegment, pCsr->nAdvance, fts3SegReaderCmp); pCsr->nAdvance = 0; @@ -128606,32 +127360,27 @@ ** If this function is called with iLevel<0, but there is only one ** segment in the database, SQLITE_DONE is returned immediately. ** Otherwise, if successful, SQLITE_OK is returned. If an error occurs, ** an SQLite error code is returned. */ -static int fts3SegmentMerge( - Fts3Table *p, - int iLangid, /* Language id to merge */ - int iIndex, /* Index in p->aIndex[] to merge */ - int iLevel /* Level to merge */ -){ +static int fts3SegmentMerge(Fts3Table *p, int iIndex, int iLevel){ int rc; /* Return code */ int iIdx = 0; /* Index of new segment */ - sqlite3_int64 iNewLevel = 0; /* Level/index to create new segment at */ + int iNewLevel = 0; /* Level/index to create new segment at */ SegmentWriter *pWriter = 0; /* Used to write the new, merged, segment */ Fts3SegFilter filter; /* Segment term filter condition */ - Fts3MultiSegReader csr; /* Cursor to iterate through level(s) */ + Fts3MultiSegReader csr; /* Cursor to iterate through level(s) */ int bIgnoreEmpty = 0; /* True to ignore empty segments */ assert( iLevel==FTS3_SEGCURSOR_ALL || iLevel==FTS3_SEGCURSOR_PENDING || iLevel>=0 ); assert( iLevel=0 && iIndexnIndex ); - rc = sqlite3Fts3SegReaderCursor(p, iLangid, iIndex, iLevel, 0, 0, 1, 0, &csr); + rc = sqlite3Fts3SegReaderCursor(p, iIndex, iLevel, 0, 0, 1, 0, &csr); if( rc!=SQLITE_OK || csr.nSegment==0 ) goto finished; if( iLevel==FTS3_SEGCURSOR_ALL ){ /* This call is to merge all segments in the database to a single ** segment. The level of the new segment is equal to the the numerically @@ -128639,28 +127388,28 @@ ** index. The idx of the new segment is always 0. */ if( csr.nSegment==1 ){ rc = SQLITE_DONE; goto finished; } - rc = fts3SegmentMaxLevel(p, iLangid, iIndex, &iNewLevel); + rc = fts3SegmentMaxLevel(p, iIndex, &iNewLevel); bIgnoreEmpty = 1; }else if( iLevel==FTS3_SEGCURSOR_PENDING ){ - iNewLevel = getAbsoluteLevel(p, iLangid, iIndex, 0); - rc = fts3AllocateSegdirIdx(p, iLangid, iIndex, 0, &iIdx); + iNewLevel = iIndex * FTS3_SEGDIR_MAXLEVEL; + rc = fts3AllocateSegdirIdx(p, iIndex, 0, &iIdx); }else{ /* This call is to merge all segments at level iLevel. find the next ** available segment index at level iLevel+1. The call to ** fts3AllocateSegdirIdx() will merge the segments at level iLevel+1 to ** a single iLevel+2 segment if necessary. */ - rc = fts3AllocateSegdirIdx(p, iLangid, iIndex, iLevel+1, &iIdx); - iNewLevel = getAbsoluteLevel(p, iLangid, iIndex, iLevel+1); + rc = fts3AllocateSegdirIdx(p, iIndex, iLevel+1, &iIdx); + iNewLevel = iIndex * FTS3_SEGDIR_MAXLEVEL + iLevel+1; } if( rc!=SQLITE_OK ) goto finished; assert( csr.nSegment>0 ); - assert( iNewLevel>=getAbsoluteLevel(p, iLangid, iIndex, 0) ); - assert( iNewLevel=(iIndex*FTS3_SEGDIR_MAXLEVEL) ); + assert( iNewLevel<((iIndex+1)*FTS3_SEGDIR_MAXLEVEL) ); memset(&filter, 0, sizeof(Fts3SegFilter)); filter.flags = FTS3_SEGMENT_REQUIRE_POS; filter.flags |= (bIgnoreEmpty ? FTS3_SEGMENT_IGNORE_EMPTY : 0); @@ -128673,13 +127422,11 @@ } if( rc!=SQLITE_OK ) goto finished; assert( pWriter ); if( iLevel!=FTS3_SEGCURSOR_PENDING ){ - rc = fts3DeleteSegdir( - p, iLangid, iIndex, iLevel, csr.apSegment, csr.nSegment - ); + rc = fts3DeleteSegdir(p, iIndex, iLevel, csr.apSegment, csr.nSegment); if( rc!=SQLITE_OK ) goto finished; } rc = fts3SegWriterFlush(p, pWriter, iNewLevel, iIdx); finished: @@ -128693,32 +127440,15 @@ ** Flush the contents of pendingTerms to level 0 segments. */ SQLITE_PRIVATE int sqlite3Fts3PendingTermsFlush(Fts3Table *p){ int rc = SQLITE_OK; int i; - for(i=0; rc==SQLITE_OK && inIndex; i++){ - rc = fts3SegmentMerge(p, p->iPrevLangid, i, FTS3_SEGCURSOR_PENDING); + rc = fts3SegmentMerge(p, i, FTS3_SEGCURSOR_PENDING); if( rc==SQLITE_DONE ) rc = SQLITE_OK; } sqlite3Fts3PendingTermsClear(p); - - /* Determine the auto-incr-merge setting if unknown. If enabled, - ** estimate the number of leaf blocks of content to be written - */ - if( rc==SQLITE_OK && p->bHasStat - && p->bAutoincrmerge==0xff && p->nLeafAdd>0 - ){ - sqlite3_stmt *pStmt = 0; - rc = fts3SqlStmt(p, SQL_SELECT_STAT, &pStmt, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int(pStmt, 1, FTS_STAT_AUTOINCRMERGE); - rc = sqlite3_step(pStmt); - p->bAutoincrmerge = (rc==SQLITE_ROW && sqlite3_column_int(pStmt, 0)); - rc = sqlite3_reset(pStmt); - } - } return rc; } /* ** Encode N integers as varints into a blob. @@ -128825,17 +127555,16 @@ if( a==0 ){ *pRC = SQLITE_NOMEM; return; } pBlob = (char*)&a[nStat]; - rc = fts3SqlStmt(p, SQL_SELECT_STAT, &pStmt, 0); + rc = fts3SqlStmt(p, SQL_SELECT_DOCTOTAL, &pStmt, 0); if( rc ){ sqlite3_free(a); *pRC = rc; return; } - sqlite3_bind_int(pStmt, 1, FTS_STAT_DOCTOTAL); if( sqlite3_step(pStmt)==SQLITE_ROW ){ fts3DecodeIntArray(nStat, a, sqlite3_column_blob(pStmt, 0), sqlite3_column_bytes(pStmt, 0)); }else{ @@ -128855,51 +127584,33 @@ x = x + aSzIns[i] - aSzDel[i]; } a[i+1] = x; } fts3EncodeIntArray(nStat, a, pBlob, &nBlob); - rc = fts3SqlStmt(p, SQL_REPLACE_STAT, &pStmt, 0); + rc = fts3SqlStmt(p, SQL_REPLACE_DOCTOTAL, &pStmt, 0); if( rc ){ sqlite3_free(a); *pRC = rc; return; } - sqlite3_bind_int(pStmt, 1, FTS_STAT_DOCTOTAL); - sqlite3_bind_blob(pStmt, 2, pBlob, nBlob, SQLITE_STATIC); + sqlite3_bind_blob(pStmt, 1, pBlob, nBlob, SQLITE_STATIC); sqlite3_step(pStmt); *pRC = sqlite3_reset(pStmt); sqlite3_free(a); } -/* -** Merge the entire database so that there is one segment for each -** iIndex/iLangid combination. -*/ static int fts3DoOptimize(Fts3Table *p, int bReturnDone){ + int i; int bSeenDone = 0; - int rc; - sqlite3_stmt *pAllLangid = 0; - - rc = fts3SqlStmt(p, SQL_SELECT_ALL_LANGID, &pAllLangid, 0); - if( rc==SQLITE_OK ){ - int rc2; - sqlite3_bind_int(pAllLangid, 1, p->nIndex); - while( sqlite3_step(pAllLangid)==SQLITE_ROW ){ - int i; - int iLangid = sqlite3_column_int(pAllLangid, 0); - for(i=0; rc==SQLITE_OK && inIndex; i++){ - rc = fts3SegmentMerge(p, iLangid, i, FTS3_SEGCURSOR_ALL); - if( rc==SQLITE_DONE ){ - bSeenDone = 1; - rc = SQLITE_OK; - } - } - } - rc2 = sqlite3_reset(pAllLangid); - if( rc==SQLITE_OK ) rc = rc2; - } - + int rc = SQLITE_OK; + for(i=0; rc==SQLITE_OK && inIndex; i++){ + rc = fts3SegmentMerge(p, i, FTS3_SEGCURSOR_ALL); + if( rc==SQLITE_DONE ){ + bSeenDone = 1; + rc = SQLITE_OK; + } + } sqlite3Fts3SegmentsClose(p); sqlite3Fts3PendingTermsClear(p); return (rc==SQLITE_OK && bReturnDone && bSeenDone) ? SQLITE_DONE : rc; } @@ -128946,16 +127657,15 @@ } } while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ int iCol; - int iLangid = langidFromSelect(p, pStmt); - rc = fts3PendingTermsDocid(p, iLangid, sqlite3_column_int64(pStmt, 0)); + rc = fts3PendingTermsDocid(p, sqlite3_column_int64(pStmt, 0)); aSz[p->nColumn] = 0; for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ const char *z = (const char *) sqlite3_column_text(pStmt, iCol+1); - rc = fts3PendingTermsAdd(p, iLangid, z, iCol, &aSz[iCol]); + rc = fts3PendingTermsAdd(p, z, iCol, &aSz[iCol]); aSz[p->nColumn] += sqlite3_column_bytes(pStmt, iCol+1); } if( p->bHasDocsize ){ fts3InsertDocsize(&rc, p, aSz); } @@ -128967,11 +127677,11 @@ for(iCol=0; iCol<=p->nColumn; iCol++){ aSzIns[iCol] += aSz[iCol]; } } } - if( p->bFts4 ){ + if( p->bHasStat ){ fts3UpdateDocTotals(&rc, p, aSzIns, aSzDel, nEntry); } sqlite3_free(aSz); if( pStmt ){ @@ -128983,1691 +127693,10 @@ } return rc; } - -/* -** This function opens a cursor used to read the input data for an -** incremental merge operation. Specifically, it opens a cursor to scan -** the oldest nSeg segments (idx=0 through idx=(nSeg-1)) in absolute -** level iAbsLevel. -*/ -static int fts3IncrmergeCsr( - Fts3Table *p, /* FTS3 table handle */ - sqlite3_int64 iAbsLevel, /* Absolute level to open */ - int nSeg, /* Number of segments to merge */ - Fts3MultiSegReader *pCsr /* Cursor object to populate */ -){ - int rc; /* Return Code */ - sqlite3_stmt *pStmt = 0; /* Statement used to read %_segdir entry */ - int nByte; /* Bytes allocated at pCsr->apSegment[] */ - - /* Allocate space for the Fts3MultiSegReader.aCsr[] array */ - memset(pCsr, 0, sizeof(*pCsr)); - nByte = sizeof(Fts3SegReader *) * nSeg; - pCsr->apSegment = (Fts3SegReader **)sqlite3_malloc(nByte); - - if( pCsr->apSegment==0 ){ - rc = SQLITE_NOMEM; - }else{ - memset(pCsr->apSegment, 0, nByte); - rc = fts3SqlStmt(p, SQL_SELECT_LEVEL, &pStmt, 0); - } - if( rc==SQLITE_OK ){ - int i; - int rc2; - sqlite3_bind_int64(pStmt, 1, iAbsLevel); - assert( pCsr->nSegment==0 ); - for(i=0; rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW && iapSegment[i] - ); - pCsr->nSegment++; - } - rc2 = sqlite3_reset(pStmt); - if( rc==SQLITE_OK ) rc = rc2; - } - - return rc; -} - -typedef struct IncrmergeWriter IncrmergeWriter; -typedef struct NodeWriter NodeWriter; -typedef struct Blob Blob; -typedef struct NodeReader NodeReader; - -/* -** An instance of the following structure is used as a dynamic buffer -** to build up nodes or other blobs of data in. -** -** The function blobGrowBuffer() is used to extend the allocation. -*/ -struct Blob { - char *a; /* Pointer to allocation */ - int n; /* Number of valid bytes of data in a[] */ - int nAlloc; /* Allocated size of a[] (nAlloc>=n) */ -}; - -/* -** This structure is used to build up buffers containing segment b-tree -** nodes (blocks). -*/ -struct NodeWriter { - sqlite3_int64 iBlock; /* Current block id */ - Blob key; /* Last key written to the current block */ - Blob block; /* Current block image */ -}; - -/* -** An object of this type contains the state required to create or append -** to an appendable b-tree segment. -*/ -struct IncrmergeWriter { - int nLeafEst; /* Space allocated for leaf blocks */ - int nWork; /* Number of leaf pages flushed */ - sqlite3_int64 iAbsLevel; /* Absolute level of input segments */ - int iIdx; /* Index of *output* segment in iAbsLevel+1 */ - sqlite3_int64 iStart; /* Block number of first allocated block */ - sqlite3_int64 iEnd; /* Block number of last allocated block */ - NodeWriter aNodeWriter[FTS_MAX_APPENDABLE_HEIGHT]; -}; - -/* -** An object of the following type is used to read data from a single -** FTS segment node. See the following functions: -** -** nodeReaderInit() -** nodeReaderNext() -** nodeReaderRelease() -*/ -struct NodeReader { - const char *aNode; - int nNode; - int iOff; /* Current offset within aNode[] */ - - /* Output variables. Containing the current node entry. */ - sqlite3_int64 iChild; /* Pointer to child node */ - Blob term; /* Current term */ - const char *aDoclist; /* Pointer to doclist */ - int nDoclist; /* Size of doclist in bytes */ -}; - -/* -** If *pRc is not SQLITE_OK when this function is called, it is a no-op. -** Otherwise, if the allocation at pBlob->a is not already at least nMin -** bytes in size, extend (realloc) it to be so. -** -** If an OOM error occurs, set *pRc to SQLITE_NOMEM and leave pBlob->a -** unmodified. Otherwise, if the allocation succeeds, update pBlob->nAlloc -** to reflect the new size of the pBlob->a[] buffer. -*/ -static void blobGrowBuffer(Blob *pBlob, int nMin, int *pRc){ - if( *pRc==SQLITE_OK && nMin>pBlob->nAlloc ){ - int nAlloc = nMin; - char *a = (char *)sqlite3_realloc(pBlob->a, nAlloc); - if( a ){ - pBlob->nAlloc = nAlloc; - pBlob->a = a; - }else{ - *pRc = SQLITE_NOMEM; - } - } -} - -/* -** Attempt to advance the node-reader object passed as the first argument to -** the next entry on the node. -** -** Return an error code if an error occurs (SQLITE_NOMEM is possible). -** Otherwise return SQLITE_OK. If there is no next entry on the node -** (e.g. because the current entry is the last) set NodeReader->aNode to -** NULL to indicate EOF. Otherwise, populate the NodeReader structure output -** variables for the new entry. -*/ -static int nodeReaderNext(NodeReader *p){ - int bFirst = (p->term.n==0); /* True for first term on the node */ - int nPrefix = 0; /* Bytes to copy from previous term */ - int nSuffix = 0; /* Bytes to append to the prefix */ - int rc = SQLITE_OK; /* Return code */ - - assert( p->aNode ); - if( p->iChild && bFirst==0 ) p->iChild++; - if( p->iOff>=p->nNode ){ - /* EOF */ - p->aNode = 0; - }else{ - if( bFirst==0 ){ - p->iOff += sqlite3Fts3GetVarint32(&p->aNode[p->iOff], &nPrefix); - } - p->iOff += sqlite3Fts3GetVarint32(&p->aNode[p->iOff], &nSuffix); - - blobGrowBuffer(&p->term, nPrefix+nSuffix, &rc); - if( rc==SQLITE_OK ){ - memcpy(&p->term.a[nPrefix], &p->aNode[p->iOff], nSuffix); - p->term.n = nPrefix+nSuffix; - p->iOff += nSuffix; - if( p->iChild==0 ){ - p->iOff += sqlite3Fts3GetVarint32(&p->aNode[p->iOff], &p->nDoclist); - p->aDoclist = &p->aNode[p->iOff]; - p->iOff += p->nDoclist; - } - } - } - - assert( p->iOff<=p->nNode ); - - return rc; -} - -/* -** Release all dynamic resources held by node-reader object *p. -*/ -static void nodeReaderRelease(NodeReader *p){ - sqlite3_free(p->term.a); -} - -/* -** Initialize a node-reader object to read the node in buffer aNode/nNode. -** -** If successful, SQLITE_OK is returned and the NodeReader object set to -** point to the first entry on the node (if any). Otherwise, an SQLite -** error code is returned. -*/ -static int nodeReaderInit(NodeReader *p, const char *aNode, int nNode){ - memset(p, 0, sizeof(NodeReader)); - p->aNode = aNode; - p->nNode = nNode; - - /* Figure out if this is a leaf or an internal node. */ - if( p->aNode[0] ){ - /* An internal node. */ - p->iOff = 1 + sqlite3Fts3GetVarint(&p->aNode[1], &p->iChild); - }else{ - p->iOff = 1; - } - - return nodeReaderNext(p); -} - -/* -** This function is called while writing an FTS segment each time a leaf o -** node is finished and written to disk. The key (zTerm/nTerm) is guaranteed -** to be greater than the largest key on the node just written, but smaller -** than or equal to the first key that will be written to the next leaf -** node. -** -** The block id of the leaf node just written to disk may be found in -** (pWriter->aNodeWriter[0].iBlock) when this function is called. -*/ -static int fts3IncrmergePush( - Fts3Table *p, /* Fts3 table handle */ - IncrmergeWriter *pWriter, /* Writer object */ - const char *zTerm, /* Term to write to internal node */ - int nTerm /* Bytes at zTerm */ -){ - sqlite3_int64 iPtr = pWriter->aNodeWriter[0].iBlock; - int iLayer; - - assert( nTerm>0 ); - for(iLayer=1; ALWAYS(iLayeraNodeWriter[iLayer]; - int rc = SQLITE_OK; - int nPrefix; - int nSuffix; - int nSpace; - - /* Figure out how much space the key will consume if it is written to - ** the current node of layer iLayer. Due to the prefix compression, - ** the space required changes depending on which node the key is to - ** be added to. */ - nPrefix = fts3PrefixCompress(pNode->key.a, pNode->key.n, zTerm, nTerm); - nSuffix = nTerm - nPrefix; - nSpace = sqlite3Fts3VarintLen(nPrefix); - nSpace += sqlite3Fts3VarintLen(nSuffix) + nSuffix; - - if( pNode->key.n==0 || (pNode->block.n + nSpace)<=p->nNodeSize ){ - /* If the current node of layer iLayer contains zero keys, or if adding - ** the key to it will not cause it to grow to larger than nNodeSize - ** bytes in size, write the key here. */ - - Blob *pBlk = &pNode->block; - if( pBlk->n==0 ){ - blobGrowBuffer(pBlk, p->nNodeSize, &rc); - if( rc==SQLITE_OK ){ - pBlk->a[0] = (char)iLayer; - pBlk->n = 1 + sqlite3Fts3PutVarint(&pBlk->a[1], iPtr); - } - } - blobGrowBuffer(pBlk, pBlk->n + nSpace, &rc); - blobGrowBuffer(&pNode->key, nTerm, &rc); - - if( rc==SQLITE_OK ){ - if( pNode->key.n ){ - pBlk->n += sqlite3Fts3PutVarint(&pBlk->a[pBlk->n], nPrefix); - } - pBlk->n += sqlite3Fts3PutVarint(&pBlk->a[pBlk->n], nSuffix); - memcpy(&pBlk->a[pBlk->n], &zTerm[nPrefix], nSuffix); - pBlk->n += nSuffix; - - memcpy(pNode->key.a, zTerm, nTerm); - pNode->key.n = nTerm; - } - }else{ - /* Otherwise, flush the the current node of layer iLayer to disk. - ** Then allocate a new, empty sibling node. The key will be written - ** into the parent of this node. */ - rc = fts3WriteSegment(p, pNode->iBlock, pNode->block.a, pNode->block.n); - - assert( pNode->block.nAlloc>=p->nNodeSize ); - pNode->block.a[0] = (char)iLayer; - pNode->block.n = 1 + sqlite3Fts3PutVarint(&pNode->block.a[1], iPtr+1); - - iNextPtr = pNode->iBlock; - pNode->iBlock++; - pNode->key.n = 0; - } - - if( rc!=SQLITE_OK || iNextPtr==0 ) return rc; - iPtr = iNextPtr; - } - - assert( 0 ); - return 0; -} - -/* -** Append a term and (optionally) doclist to the FTS segment node currently -** stored in blob *pNode. The node need not contain any terms, but the -** header must be written before this function is called. -** -** A node header is a single 0x00 byte for a leaf node, or a height varint -** followed by the left-hand-child varint for an internal node. -** -** The term to be appended is passed via arguments zTerm/nTerm. For a -** leaf node, the doclist is passed as aDoclist/nDoclist. For an internal -** node, both aDoclist and nDoclist must be passed 0. -** -** If the size of the value in blob pPrev is zero, then this is the first -** term written to the node. Otherwise, pPrev contains a copy of the -** previous term. Before this function returns, it is updated to contain a -** copy of zTerm/nTerm. -** -** It is assumed that the buffer associated with pNode is already large -** enough to accommodate the new entry. The buffer associated with pPrev -** is extended by this function if requrired. -** -** If an error (i.e. OOM condition) occurs, an SQLite error code is -** returned. Otherwise, SQLITE_OK. -*/ -static int fts3AppendToNode( - Blob *pNode, /* Current node image to append to */ - Blob *pPrev, /* Buffer containing previous term written */ - const char *zTerm, /* New term to write */ - int nTerm, /* Size of zTerm in bytes */ - const char *aDoclist, /* Doclist (or NULL) to write */ - int nDoclist /* Size of aDoclist in bytes */ -){ - int rc = SQLITE_OK; /* Return code */ - int bFirst = (pPrev->n==0); /* True if this is the first term written */ - int nPrefix; /* Size of term prefix in bytes */ - int nSuffix; /* Size of term suffix in bytes */ - - /* Node must have already been started. There must be a doclist for a - ** leaf node, and there must not be a doclist for an internal node. */ - assert( pNode->n>0 ); - assert( (pNode->a[0]=='\0')==(aDoclist!=0) ); - - blobGrowBuffer(pPrev, nTerm, &rc); - if( rc!=SQLITE_OK ) return rc; - - nPrefix = fts3PrefixCompress(pPrev->a, pPrev->n, zTerm, nTerm); - nSuffix = nTerm - nPrefix; - memcpy(pPrev->a, zTerm, nTerm); - pPrev->n = nTerm; - - if( bFirst==0 ){ - pNode->n += sqlite3Fts3PutVarint(&pNode->a[pNode->n], nPrefix); - } - pNode->n += sqlite3Fts3PutVarint(&pNode->a[pNode->n], nSuffix); - memcpy(&pNode->a[pNode->n], &zTerm[nPrefix], nSuffix); - pNode->n += nSuffix; - - if( aDoclist ){ - pNode->n += sqlite3Fts3PutVarint(&pNode->a[pNode->n], nDoclist); - memcpy(&pNode->a[pNode->n], aDoclist, nDoclist); - pNode->n += nDoclist; - } - - assert( pNode->n<=pNode->nAlloc ); - - return SQLITE_OK; -} - -/* -** Append the current term and doclist pointed to by cursor pCsr to the -** appendable b-tree segment opened for writing by pWriter. -** -** Return SQLITE_OK if successful, or an SQLite error code otherwise. -*/ -static int fts3IncrmergeAppend( - Fts3Table *p, /* Fts3 table handle */ - IncrmergeWriter *pWriter, /* Writer object */ - Fts3MultiSegReader *pCsr /* Cursor containing term and doclist */ -){ - const char *zTerm = pCsr->zTerm; - int nTerm = pCsr->nTerm; - const char *aDoclist = pCsr->aDoclist; - int nDoclist = pCsr->nDoclist; - int rc = SQLITE_OK; /* Return code */ - int nSpace; /* Total space in bytes required on leaf */ - int nPrefix; /* Size of prefix shared with previous term */ - int nSuffix; /* Size of suffix (nTerm - nPrefix) */ - NodeWriter *pLeaf; /* Object used to write leaf nodes */ - - pLeaf = &pWriter->aNodeWriter[0]; - nPrefix = fts3PrefixCompress(pLeaf->key.a, pLeaf->key.n, zTerm, nTerm); - nSuffix = nTerm - nPrefix; - - nSpace = sqlite3Fts3VarintLen(nPrefix); - nSpace += sqlite3Fts3VarintLen(nSuffix) + nSuffix; - nSpace += sqlite3Fts3VarintLen(nDoclist) + nDoclist; - - /* If the current block is not empty, and if adding this term/doclist - ** to the current block would make it larger than Fts3Table.nNodeSize - ** bytes, write this block out to the database. */ - if( pLeaf->block.n>0 && (pLeaf->block.n + nSpace)>p->nNodeSize ){ - rc = fts3WriteSegment(p, pLeaf->iBlock, pLeaf->block.a, pLeaf->block.n); - pWriter->nWork++; - - /* Add the current term to the parent node. The term added to the - ** parent must: - ** - ** a) be greater than the largest term on the leaf node just written - ** to the database (still available in pLeaf->key), and - ** - ** b) be less than or equal to the term about to be added to the new - ** leaf node (zTerm/nTerm). - ** - ** In other words, it must be the prefix of zTerm 1 byte longer than - ** the common prefix (if any) of zTerm and pWriter->zTerm. - */ - if( rc==SQLITE_OK ){ - rc = fts3IncrmergePush(p, pWriter, zTerm, nPrefix+1); - } - - /* Advance to the next output block */ - pLeaf->iBlock++; - pLeaf->key.n = 0; - pLeaf->block.n = 0; - - nSuffix = nTerm; - nSpace = 1; - nSpace += sqlite3Fts3VarintLen(nSuffix) + nSuffix; - nSpace += sqlite3Fts3VarintLen(nDoclist) + nDoclist; - } - - blobGrowBuffer(&pLeaf->block, pLeaf->block.n + nSpace, &rc); - - if( rc==SQLITE_OK ){ - if( pLeaf->block.n==0 ){ - pLeaf->block.n = 1; - pLeaf->block.a[0] = '\0'; - } - rc = fts3AppendToNode( - &pLeaf->block, &pLeaf->key, zTerm, nTerm, aDoclist, nDoclist - ); - } - - return rc; -} - -/* -** This function is called to release all dynamic resources held by the -** merge-writer object pWriter, and if no error has occurred, to flush -** all outstanding node buffers held by pWriter to disk. -** -** If *pRc is not SQLITE_OK when this function is called, then no attempt -** is made to write any data to disk. Instead, this function serves only -** to release outstanding resources. -** -** Otherwise, if *pRc is initially SQLITE_OK and an error occurs while -** flushing buffers to disk, *pRc is set to an SQLite error code before -** returning. -*/ -static void fts3IncrmergeRelease( - Fts3Table *p, /* FTS3 table handle */ - IncrmergeWriter *pWriter, /* Merge-writer object */ - int *pRc /* IN/OUT: Error code */ -){ - int i; /* Used to iterate through non-root layers */ - int iRoot; /* Index of root in pWriter->aNodeWriter */ - NodeWriter *pRoot; /* NodeWriter for root node */ - int rc = *pRc; /* Error code */ - - /* Set iRoot to the index in pWriter->aNodeWriter[] of the output segment - ** root node. If the segment fits entirely on a single leaf node, iRoot - ** will be set to 0. If the root node is the parent of the leaves, iRoot - ** will be 1. And so on. */ - for(iRoot=FTS_MAX_APPENDABLE_HEIGHT-1; iRoot>=0; iRoot--){ - NodeWriter *pNode = &pWriter->aNodeWriter[iRoot]; - if( pNode->block.n>0 ) break; - assert( *pRc || pNode->block.nAlloc==0 ); - assert( *pRc || pNode->key.nAlloc==0 ); - sqlite3_free(pNode->block.a); - sqlite3_free(pNode->key.a); - } - - /* Empty output segment. This is a no-op. */ - if( iRoot<0 ) return; - - /* The entire output segment fits on a single node. Normally, this means - ** the node would be stored as a blob in the "root" column of the %_segdir - ** table. However, this is not permitted in this case. The problem is that - ** space has already been reserved in the %_segments table, and so the - ** start_block and end_block fields of the %_segdir table must be populated. - ** And, by design or by accident, released versions of FTS cannot handle - ** segments that fit entirely on the root node with start_block!=0. - ** - ** Instead, create a synthetic root node that contains nothing but a - ** pointer to the single content node. So that the segment consists of a - ** single leaf and a single interior (root) node. - ** - ** Todo: Better might be to defer allocating space in the %_segments - ** table until we are sure it is needed. - */ - if( iRoot==0 ){ - Blob *pBlock = &pWriter->aNodeWriter[1].block; - blobGrowBuffer(pBlock, 1 + FTS3_VARINT_MAX, &rc); - if( rc==SQLITE_OK ){ - pBlock->a[0] = 0x01; - pBlock->n = 1 + sqlite3Fts3PutVarint( - &pBlock->a[1], pWriter->aNodeWriter[0].iBlock - ); - } - iRoot = 1; - } - pRoot = &pWriter->aNodeWriter[iRoot]; - - /* Flush all currently outstanding nodes to disk. */ - for(i=0; iaNodeWriter[i]; - if( pNode->block.n>0 && rc==SQLITE_OK ){ - rc = fts3WriteSegment(p, pNode->iBlock, pNode->block.a, pNode->block.n); - } - sqlite3_free(pNode->block.a); - sqlite3_free(pNode->key.a); - } - - /* Write the %_segdir record. */ - if( rc==SQLITE_OK ){ - rc = fts3WriteSegdir(p, - pWriter->iAbsLevel+1, /* level */ - pWriter->iIdx, /* idx */ - pWriter->iStart, /* start_block */ - pWriter->aNodeWriter[0].iBlock, /* leaves_end_block */ - pWriter->iEnd, /* end_block */ - pRoot->block.a, pRoot->block.n /* root */ - ); - } - sqlite3_free(pRoot->block.a); - sqlite3_free(pRoot->key.a); - - *pRc = rc; -} - -/* -** Compare the term in buffer zLhs (size in bytes nLhs) with that in -** zRhs (size in bytes nRhs) using memcmp. If one term is a prefix of -** the other, it is considered to be smaller than the other. -** -** Return -ve if zLhs is smaller than zRhs, 0 if it is equal, or +ve -** if it is greater. -*/ -static int fts3TermCmp( - const char *zLhs, int nLhs, /* LHS of comparison */ - const char *zRhs, int nRhs /* RHS of comparison */ -){ - int nCmp = MIN(nLhs, nRhs); - int res; - - res = memcmp(zLhs, zRhs, nCmp); - if( res==0 ) res = nLhs - nRhs; - - return res; -} - - -/* -** Query to see if the entry in the %_segments table with blockid iEnd is -** NULL. If no error occurs and the entry is NULL, set *pbRes 1 before -** returning. Otherwise, set *pbRes to 0. -** -** Or, if an error occurs while querying the database, return an SQLite -** error code. The final value of *pbRes is undefined in this case. -** -** This is used to test if a segment is an "appendable" segment. If it -** is, then a NULL entry has been inserted into the %_segments table -** with blockid %_segdir.end_block. -*/ -static int fts3IsAppendable(Fts3Table *p, sqlite3_int64 iEnd, int *pbRes){ - int bRes = 0; /* Result to set *pbRes to */ - sqlite3_stmt *pCheck = 0; /* Statement to query database with */ - int rc; /* Return code */ - - rc = fts3SqlStmt(p, SQL_SEGMENT_IS_APPENDABLE, &pCheck, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pCheck, 1, iEnd); - if( SQLITE_ROW==sqlite3_step(pCheck) ) bRes = 1; - rc = sqlite3_reset(pCheck); - } - - *pbRes = bRes; - return rc; -} - -/* -** This function is called when initializing an incremental-merge operation. -** It checks if the existing segment with index value iIdx at absolute level -** (iAbsLevel+1) can be appended to by the incremental merge. If it can, the -** merge-writer object *pWriter is initialized to write to it. -** -** An existing segment can be appended to by an incremental merge if: -** -** * It was initially created as an appendable segment (with all required -** space pre-allocated), and -** -** * The first key read from the input (arguments zKey and nKey) is -** greater than the largest key currently stored in the potential -** output segment. -*/ -static int fts3IncrmergeLoad( - Fts3Table *p, /* Fts3 table handle */ - sqlite3_int64 iAbsLevel, /* Absolute level of input segments */ - int iIdx, /* Index of candidate output segment */ - const char *zKey, /* First key to write */ - int nKey, /* Number of bytes in nKey */ - IncrmergeWriter *pWriter /* Populate this object */ -){ - int rc; /* Return code */ - sqlite3_stmt *pSelect = 0; /* SELECT to read %_segdir entry */ - - rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR, &pSelect, 0); - if( rc==SQLITE_OK ){ - sqlite3_int64 iStart = 0; /* Value of %_segdir.start_block */ - sqlite3_int64 iLeafEnd = 0; /* Value of %_segdir.leaves_end_block */ - sqlite3_int64 iEnd = 0; /* Value of %_segdir.end_block */ - const char *aRoot = 0; /* Pointer to %_segdir.root buffer */ - int nRoot = 0; /* Size of aRoot[] in bytes */ - int rc2; /* Return code from sqlite3_reset() */ - int bAppendable = 0; /* Set to true if segment is appendable */ - - /* Read the %_segdir entry for index iIdx absolute level (iAbsLevel+1) */ - sqlite3_bind_int64(pSelect, 1, iAbsLevel+1); - sqlite3_bind_int(pSelect, 2, iIdx); - if( sqlite3_step(pSelect)==SQLITE_ROW ){ - iStart = sqlite3_column_int64(pSelect, 1); - iLeafEnd = sqlite3_column_int64(pSelect, 2); - iEnd = sqlite3_column_int64(pSelect, 3); - nRoot = sqlite3_column_bytes(pSelect, 4); - aRoot = sqlite3_column_blob(pSelect, 4); - }else{ - return sqlite3_reset(pSelect); - } - - /* Check for the zero-length marker in the %_segments table */ - rc = fts3IsAppendable(p, iEnd, &bAppendable); - - /* Check that zKey/nKey is larger than the largest key the candidate */ - if( rc==SQLITE_OK && bAppendable ){ - char *aLeaf = 0; - int nLeaf = 0; - - rc = sqlite3Fts3ReadBlock(p, iLeafEnd, &aLeaf, &nLeaf, 0); - if( rc==SQLITE_OK ){ - NodeReader reader; - for(rc = nodeReaderInit(&reader, aLeaf, nLeaf); - rc==SQLITE_OK && reader.aNode; - rc = nodeReaderNext(&reader) - ){ - assert( reader.aNode ); - } - if( fts3TermCmp(zKey, nKey, reader.term.a, reader.term.n)<=0 ){ - bAppendable = 0; - } - nodeReaderRelease(&reader); - } - sqlite3_free(aLeaf); - } - - if( rc==SQLITE_OK && bAppendable ){ - /* It is possible to append to this segment. Set up the IncrmergeWriter - ** object to do so. */ - int i; - int nHeight = (int)aRoot[0]; - NodeWriter *pNode; - - pWriter->nLeafEst = (int)((iEnd - iStart) + 1)/FTS_MAX_APPENDABLE_HEIGHT; - pWriter->iStart = iStart; - pWriter->iEnd = iEnd; - pWriter->iAbsLevel = iAbsLevel; - pWriter->iIdx = iIdx; - - for(i=nHeight+1; iaNodeWriter[i].iBlock = pWriter->iStart + i*pWriter->nLeafEst; - } - - pNode = &pWriter->aNodeWriter[nHeight]; - pNode->iBlock = pWriter->iStart + pWriter->nLeafEst*nHeight; - blobGrowBuffer(&pNode->block, MAX(nRoot, p->nNodeSize), &rc); - if( rc==SQLITE_OK ){ - memcpy(pNode->block.a, aRoot, nRoot); - pNode->block.n = nRoot; - } - - for(i=nHeight; i>=0 && rc==SQLITE_OK; i--){ - NodeReader reader; - pNode = &pWriter->aNodeWriter[i]; - - rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n); - while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader); - blobGrowBuffer(&pNode->key, reader.term.n, &rc); - if( rc==SQLITE_OK ){ - memcpy(pNode->key.a, reader.term.a, reader.term.n); - pNode->key.n = reader.term.n; - if( i>0 ){ - char *aBlock = 0; - int nBlock = 0; - pNode = &pWriter->aNodeWriter[i-1]; - pNode->iBlock = reader.iChild; - rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock, 0); - blobGrowBuffer(&pNode->block, MAX(nBlock, p->nNodeSize), &rc); - if( rc==SQLITE_OK ){ - memcpy(pNode->block.a, aBlock, nBlock); - pNode->block.n = nBlock; - } - sqlite3_free(aBlock); - } - } - nodeReaderRelease(&reader); - } - } - - rc2 = sqlite3_reset(pSelect); - if( rc==SQLITE_OK ) rc = rc2; - } - - return rc; -} - -/* -** Determine the largest segment index value that exists within absolute -** level iAbsLevel+1. If no error occurs, set *piIdx to this value plus -** one before returning SQLITE_OK. Or, if there are no segments at all -** within level iAbsLevel, set *piIdx to zero. -** -** If an error occurs, return an SQLite error code. The final value of -** *piIdx is undefined in this case. -*/ -static int fts3IncrmergeOutputIdx( - Fts3Table *p, /* FTS Table handle */ - sqlite3_int64 iAbsLevel, /* Absolute index of input segments */ - int *piIdx /* OUT: Next free index at iAbsLevel+1 */ -){ - int rc; - sqlite3_stmt *pOutputIdx = 0; /* SQL used to find output index */ - - rc = fts3SqlStmt(p, SQL_NEXT_SEGMENT_INDEX, &pOutputIdx, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pOutputIdx, 1, iAbsLevel+1); - sqlite3_step(pOutputIdx); - *piIdx = sqlite3_column_int(pOutputIdx, 0); - rc = sqlite3_reset(pOutputIdx); - } - - return rc; -} - -/* -** Allocate an appendable output segment on absolute level iAbsLevel+1 -** with idx value iIdx. -** -** In the %_segdir table, a segment is defined by the values in three -** columns: -** -** start_block -** leaves_end_block -** end_block -** -** When an appendable segment is allocated, it is estimated that the -** maximum number of leaf blocks that may be required is the sum of the -** number of leaf blocks consumed by the input segments, plus the number -** of input segments, multiplied by two. This value is stored in stack -** variable nLeafEst. -** -** A total of 16*nLeafEst blocks are allocated when an appendable segment -** is created ((1 + end_block - start_block)==16*nLeafEst). The contiguous -** array of leaf nodes starts at the first block allocated. The array -** of interior nodes that are parents of the leaf nodes start at block -** (start_block + (1 + end_block - start_block) / 16). And so on. -** -** In the actual code below, the value "16" is replaced with the -** pre-processor macro FTS_MAX_APPENDABLE_HEIGHT. -*/ -static int fts3IncrmergeWriter( - Fts3Table *p, /* Fts3 table handle */ - sqlite3_int64 iAbsLevel, /* Absolute level of input segments */ - int iIdx, /* Index of new output segment */ - Fts3MultiSegReader *pCsr, /* Cursor that data will be read from */ - IncrmergeWriter *pWriter /* Populate this object */ -){ - int rc; /* Return Code */ - int i; /* Iterator variable */ - int nLeafEst = 0; /* Blocks allocated for leaf nodes */ - sqlite3_stmt *pLeafEst = 0; /* SQL used to determine nLeafEst */ - sqlite3_stmt *pFirstBlock = 0; /* SQL used to determine first block */ - - /* Calculate nLeafEst. */ - rc = fts3SqlStmt(p, SQL_MAX_LEAF_NODE_ESTIMATE, &pLeafEst, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pLeafEst, 1, iAbsLevel); - sqlite3_bind_int64(pLeafEst, 2, pCsr->nSegment); - if( SQLITE_ROW==sqlite3_step(pLeafEst) ){ - nLeafEst = sqlite3_column_int(pLeafEst, 0); - } - rc = sqlite3_reset(pLeafEst); - } - if( rc!=SQLITE_OK ) return rc; - - /* Calculate the first block to use in the output segment */ - rc = fts3SqlStmt(p, SQL_NEXT_SEGMENTS_ID, &pFirstBlock, 0); - if( rc==SQLITE_OK ){ - if( SQLITE_ROW==sqlite3_step(pFirstBlock) ){ - pWriter->iStart = sqlite3_column_int64(pFirstBlock, 0); - pWriter->iEnd = pWriter->iStart - 1; - pWriter->iEnd += nLeafEst * FTS_MAX_APPENDABLE_HEIGHT; - } - rc = sqlite3_reset(pFirstBlock); - } - if( rc!=SQLITE_OK ) return rc; - - /* Insert the marker in the %_segments table to make sure nobody tries - ** to steal the space just allocated. This is also used to identify - ** appendable segments. */ - rc = fts3WriteSegment(p, pWriter->iEnd, 0, 0); - if( rc!=SQLITE_OK ) return rc; - - pWriter->iAbsLevel = iAbsLevel; - pWriter->nLeafEst = nLeafEst; - pWriter->iIdx = iIdx; - - /* Set up the array of NodeWriter objects */ - for(i=0; iaNodeWriter[i].iBlock = pWriter->iStart + i*pWriter->nLeafEst; - } - return SQLITE_OK; -} - -/* -** Remove an entry from the %_segdir table. This involves running the -** following two statements: -** -** DELETE FROM %_segdir WHERE level = :iAbsLevel AND idx = :iIdx -** UPDATE %_segdir SET idx = idx - 1 WHERE level = :iAbsLevel AND idx > :iIdx -** -** The DELETE statement removes the specific %_segdir level. The UPDATE -** statement ensures that the remaining segments have contiguously allocated -** idx values. -*/ -static int fts3RemoveSegdirEntry( - Fts3Table *p, /* FTS3 table handle */ - sqlite3_int64 iAbsLevel, /* Absolute level to delete from */ - int iIdx /* Index of %_segdir entry to delete */ -){ - int rc; /* Return code */ - sqlite3_stmt *pDelete = 0; /* DELETE statement */ - - rc = fts3SqlStmt(p, SQL_DELETE_SEGDIR_ENTRY, &pDelete, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pDelete, 1, iAbsLevel); - sqlite3_bind_int(pDelete, 2, iIdx); - sqlite3_step(pDelete); - rc = sqlite3_reset(pDelete); - } - - return rc; -} - -/* -** One or more segments have just been removed from absolute level iAbsLevel. -** Update the 'idx' values of the remaining segments in the level so that -** the idx values are a contiguous sequence starting from 0. -*/ -static int fts3RepackSegdirLevel( - Fts3Table *p, /* FTS3 table handle */ - sqlite3_int64 iAbsLevel /* Absolute level to repack */ -){ - int rc; /* Return code */ - int *aIdx = 0; /* Array of remaining idx values */ - int nIdx = 0; /* Valid entries in aIdx[] */ - int nAlloc = 0; /* Allocated size of aIdx[] */ - int i; /* Iterator variable */ - sqlite3_stmt *pSelect = 0; /* Select statement to read idx values */ - sqlite3_stmt *pUpdate = 0; /* Update statement to modify idx values */ - - rc = fts3SqlStmt(p, SQL_SELECT_INDEXES, &pSelect, 0); - if( rc==SQLITE_OK ){ - int rc2; - sqlite3_bind_int64(pSelect, 1, iAbsLevel); - while( SQLITE_ROW==sqlite3_step(pSelect) ){ - if( nIdx>=nAlloc ){ - int *aNew; - nAlloc += 16; - aNew = sqlite3_realloc(aIdx, nAlloc*sizeof(int)); - if( !aNew ){ - rc = SQLITE_NOMEM; - break; - } - aIdx = aNew; - } - aIdx[nIdx++] = sqlite3_column_int(pSelect, 0); - } - rc2 = sqlite3_reset(pSelect); - if( rc==SQLITE_OK ) rc = rc2; - } - - if( rc==SQLITE_OK ){ - rc = fts3SqlStmt(p, SQL_SHIFT_SEGDIR_ENTRY, &pUpdate, 0); - } - if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pUpdate, 2, iAbsLevel); - } - - assert( p->bIgnoreSavepoint==0 ); - p->bIgnoreSavepoint = 1; - for(i=0; rc==SQLITE_OK && ibIgnoreSavepoint = 0; - - sqlite3_free(aIdx); - return rc; -} - -static void fts3StartNode(Blob *pNode, int iHeight, sqlite3_int64 iChild){ - pNode->a[0] = (char)iHeight; - if( iChild ){ - assert( pNode->nAlloc>=1+sqlite3Fts3VarintLen(iChild) ); - pNode->n = 1 + sqlite3Fts3PutVarint(&pNode->a[1], iChild); - }else{ - assert( pNode->nAlloc>=1 ); - pNode->n = 1; - } -} - -/* -** The first two arguments are a pointer to and the size of a segment b-tree -** node. The node may be a leaf or an internal node. -** -** This function creates a new node image in blob object *pNew by copying -** all terms that are greater than or equal to zTerm/nTerm (for leaf nodes) -** or greater than zTerm/nTerm (for internal nodes) from aNode/nNode. -*/ -static int fts3TruncateNode( - const char *aNode, /* Current node image */ - int nNode, /* Size of aNode in bytes */ - Blob *pNew, /* OUT: Write new node image here */ - const char *zTerm, /* Omit all terms smaller than this */ - int nTerm, /* Size of zTerm in bytes */ - sqlite3_int64 *piBlock /* OUT: Block number in next layer down */ -){ - NodeReader reader; /* Reader object */ - Blob prev = {0, 0, 0}; /* Previous term written to new node */ - int rc = SQLITE_OK; /* Return code */ - int bLeaf = aNode[0]=='\0'; /* True for a leaf node */ - - /* Allocate required output space */ - blobGrowBuffer(pNew, nNode, &rc); - if( rc!=SQLITE_OK ) return rc; - pNew->n = 0; - - /* Populate new node buffer */ - for(rc = nodeReaderInit(&reader, aNode, nNode); - rc==SQLITE_OK && reader.aNode; - rc = nodeReaderNext(&reader) - ){ - if( pNew->n==0 ){ - int res = fts3TermCmp(reader.term.a, reader.term.n, zTerm, nTerm); - if( res<0 || (bLeaf==0 && res==0) ) continue; - fts3StartNode(pNew, (int)aNode[0], reader.iChild); - *piBlock = reader.iChild; - } - rc = fts3AppendToNode( - pNew, &prev, reader.term.a, reader.term.n, - reader.aDoclist, reader.nDoclist - ); - if( rc!=SQLITE_OK ) break; - } - if( pNew->n==0 ){ - fts3StartNode(pNew, (int)aNode[0], reader.iChild); - *piBlock = reader.iChild; - } - assert( pNew->n<=pNew->nAlloc ); - - nodeReaderRelease(&reader); - sqlite3_free(prev.a); - return rc; -} - -/* -** Remove all terms smaller than zTerm/nTerm from segment iIdx in absolute -** level iAbsLevel. This may involve deleting entries from the %_segments -** table, and modifying existing entries in both the %_segments and %_segdir -** tables. -** -** SQLITE_OK is returned if the segment is updated successfully. Or an -** SQLite error code otherwise. -*/ -static int fts3TruncateSegment( - Fts3Table *p, /* FTS3 table handle */ - sqlite3_int64 iAbsLevel, /* Absolute level of segment to modify */ - int iIdx, /* Index within level of segment to modify */ - const char *zTerm, /* Remove terms smaller than this */ - int nTerm /* Number of bytes in buffer zTerm */ -){ - int rc = SQLITE_OK; /* Return code */ - Blob root = {0,0,0}; /* New root page image */ - Blob block = {0,0,0}; /* Buffer used for any other block */ - sqlite3_int64 iBlock = 0; /* Block id */ - sqlite3_int64 iNewStart = 0; /* New value for iStartBlock */ - sqlite3_int64 iOldStart = 0; /* Old value for iStartBlock */ - sqlite3_stmt *pFetch = 0; /* Statement used to fetch segdir */ - - rc = fts3SqlStmt(p, SQL_SELECT_SEGDIR, &pFetch, 0); - if( rc==SQLITE_OK ){ - int rc2; /* sqlite3_reset() return code */ - sqlite3_bind_int64(pFetch, 1, iAbsLevel); - sqlite3_bind_int(pFetch, 2, iIdx); - if( SQLITE_ROW==sqlite3_step(pFetch) ){ - const char *aRoot = sqlite3_column_blob(pFetch, 4); - int nRoot = sqlite3_column_bytes(pFetch, 4); - iOldStart = sqlite3_column_int64(pFetch, 1); - rc = fts3TruncateNode(aRoot, nRoot, &root, zTerm, nTerm, &iBlock); - } - rc2 = sqlite3_reset(pFetch); - if( rc==SQLITE_OK ) rc = rc2; - } - - while( rc==SQLITE_OK && iBlock ){ - char *aBlock = 0; - int nBlock = 0; - iNewStart = iBlock; - - rc = sqlite3Fts3ReadBlock(p, iBlock, &aBlock, &nBlock, 0); - if( rc==SQLITE_OK ){ - rc = fts3TruncateNode(aBlock, nBlock, &block, zTerm, nTerm, &iBlock); - } - if( rc==SQLITE_OK ){ - rc = fts3WriteSegment(p, iNewStart, block.a, block.n); - } - sqlite3_free(aBlock); - } - - /* Variable iNewStart now contains the first valid leaf node. */ - if( rc==SQLITE_OK && iNewStart ){ - sqlite3_stmt *pDel = 0; - rc = fts3SqlStmt(p, SQL_DELETE_SEGMENTS_RANGE, &pDel, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pDel, 1, iOldStart); - sqlite3_bind_int64(pDel, 2, iNewStart-1); - sqlite3_step(pDel); - rc = sqlite3_reset(pDel); - } - } - - if( rc==SQLITE_OK ){ - sqlite3_stmt *pChomp = 0; - rc = fts3SqlStmt(p, SQL_CHOMP_SEGDIR, &pChomp, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int64(pChomp, 1, iNewStart); - sqlite3_bind_blob(pChomp, 2, root.a, root.n, SQLITE_STATIC); - sqlite3_bind_int64(pChomp, 3, iAbsLevel); - sqlite3_bind_int(pChomp, 4, iIdx); - sqlite3_step(pChomp); - rc = sqlite3_reset(pChomp); - } - } - - sqlite3_free(root.a); - sqlite3_free(block.a); - return rc; -} - -/* -** This function is called after an incrmental-merge operation has run to -** merge (or partially merge) two or more segments from absolute level -** iAbsLevel. -** -** Each input segment is either removed from the db completely (if all of -** its data was copied to the output segment by the incrmerge operation) -** or modified in place so that it no longer contains those entries that -** have been duplicated in the output segment. -*/ -static int fts3IncrmergeChomp( - Fts3Table *p, /* FTS table handle */ - sqlite3_int64 iAbsLevel, /* Absolute level containing segments */ - Fts3MultiSegReader *pCsr, /* Chomp all segments opened by this cursor */ - int *pnRem /* Number of segments not deleted */ -){ - int i; - int nRem = 0; - int rc = SQLITE_OK; - - for(i=pCsr->nSegment-1; i>=0 && rc==SQLITE_OK; i--){ - Fts3SegReader *pSeg = 0; - int j; - - /* Find the Fts3SegReader object with Fts3SegReader.iIdx==i. It is hiding - ** somewhere in the pCsr->apSegment[] array. */ - for(j=0; ALWAYS(jnSegment); j++){ - pSeg = pCsr->apSegment[j]; - if( pSeg->iIdx==i ) break; - } - assert( jnSegment && pSeg->iIdx==i ); - - if( pSeg->aNode==0 ){ - /* Seg-reader is at EOF. Remove the entire input segment. */ - rc = fts3DeleteSegment(p, pSeg); - if( rc==SQLITE_OK ){ - rc = fts3RemoveSegdirEntry(p, iAbsLevel, pSeg->iIdx); - } - *pnRem = 0; - }else{ - /* The incremental merge did not copy all the data from this - ** segment to the upper level. The segment is modified in place - ** so that it contains no keys smaller than zTerm/nTerm. */ - const char *zTerm = pSeg->zTerm; - int nTerm = pSeg->nTerm; - rc = fts3TruncateSegment(p, iAbsLevel, pSeg->iIdx, zTerm, nTerm); - nRem++; - } - } - - if( rc==SQLITE_OK && nRem!=pCsr->nSegment ){ - rc = fts3RepackSegdirLevel(p, iAbsLevel); - } - - *pnRem = nRem; - return rc; -} - -/* -** Store an incr-merge hint in the database. -*/ -static int fts3IncrmergeHintStore(Fts3Table *p, Blob *pHint){ - sqlite3_stmt *pReplace = 0; - int rc; /* Return code */ - - rc = fts3SqlStmt(p, SQL_REPLACE_STAT, &pReplace, 0); - if( rc==SQLITE_OK ){ - sqlite3_bind_int(pReplace, 1, FTS_STAT_INCRMERGEHINT); - sqlite3_bind_blob(pReplace, 2, pHint->a, pHint->n, SQLITE_STATIC); - sqlite3_step(pReplace); - rc = sqlite3_reset(pReplace); - } - - return rc; -} - -/* -** Load an incr-merge hint from the database. The incr-merge hint, if one -** exists, is stored in the rowid==1 row of the %_stat table. -** -** If successful, populate blob *pHint with the value read from the %_stat -** table and return SQLITE_OK. Otherwise, if an error occurs, return an -** SQLite error code. -*/ -static int fts3IncrmergeHintLoad(Fts3Table *p, Blob *pHint){ - sqlite3_stmt *pSelect = 0; - int rc; - - pHint->n = 0; - rc = fts3SqlStmt(p, SQL_SELECT_STAT, &pSelect, 0); - if( rc==SQLITE_OK ){ - int rc2; - sqlite3_bind_int(pSelect, 1, FTS_STAT_INCRMERGEHINT); - if( SQLITE_ROW==sqlite3_step(pSelect) ){ - const char *aHint = sqlite3_column_blob(pSelect, 0); - int nHint = sqlite3_column_bytes(pSelect, 0); - if( aHint ){ - blobGrowBuffer(pHint, nHint, &rc); - if( rc==SQLITE_OK ){ - memcpy(pHint->a, aHint, nHint); - pHint->n = nHint; - } - } - } - rc2 = sqlite3_reset(pSelect); - if( rc==SQLITE_OK ) rc = rc2; - } - - return rc; -} - -/* -** If *pRc is not SQLITE_OK when this function is called, it is a no-op. -** Otherwise, append an entry to the hint stored in blob *pHint. Each entry -** consists of two varints, the absolute level number of the input segments -** and the number of input segments. -** -** If successful, leave *pRc set to SQLITE_OK and return. If an error occurs, -** set *pRc to an SQLite error code before returning. -*/ -static void fts3IncrmergeHintPush( - Blob *pHint, /* Hint blob to append to */ - i64 iAbsLevel, /* First varint to store in hint */ - int nInput, /* Second varint to store in hint */ - int *pRc /* IN/OUT: Error code */ -){ - blobGrowBuffer(pHint, pHint->n + 2*FTS3_VARINT_MAX, pRc); - if( *pRc==SQLITE_OK ){ - pHint->n += sqlite3Fts3PutVarint(&pHint->a[pHint->n], iAbsLevel); - pHint->n += sqlite3Fts3PutVarint(&pHint->a[pHint->n], (i64)nInput); - } -} - -/* -** Read the last entry (most recently pushed) from the hint blob *pHint -** and then remove the entry. Write the two values read to *piAbsLevel and -** *pnInput before returning. -** -** If no error occurs, return SQLITE_OK. If the hint blob in *pHint does -** not contain at least two valid varints, return SQLITE_CORRUPT_VTAB. -*/ -static int fts3IncrmergeHintPop(Blob *pHint, i64 *piAbsLevel, int *pnInput){ - const int nHint = pHint->n; - int i; - - i = pHint->n-2; - while( i>0 && (pHint->a[i-1] & 0x80) ) i--; - while( i>0 && (pHint->a[i-1] & 0x80) ) i--; - - pHint->n = i; - i += sqlite3Fts3GetVarint(&pHint->a[i], piAbsLevel); - i += sqlite3Fts3GetVarint32(&pHint->a[i], pnInput); - if( i!=nHint ) return SQLITE_CORRUPT_VTAB; - - return SQLITE_OK; -} - - -/* -** Attempt an incremental merge that writes nMerge leaf blocks. -** -** Incremental merges happen nMin segments at a time. The two -** segments to be merged are the nMin oldest segments (the ones with -** the smallest indexes) in the highest level that contains at least -** nMin segments. Multiple merges might occur in an attempt to write the -** quota of nMerge leaf blocks. -*/ -SQLITE_PRIVATE int sqlite3Fts3Incrmerge(Fts3Table *p, int nMerge, int nMin){ - int rc; /* Return code */ - int nRem = nMerge; /* Number of leaf pages yet to be written */ - Fts3MultiSegReader *pCsr; /* Cursor used to read input data */ - Fts3SegFilter *pFilter; /* Filter used with cursor pCsr */ - IncrmergeWriter *pWriter; /* Writer object */ - int nSeg = 0; /* Number of input segments */ - sqlite3_int64 iAbsLevel = 0; /* Absolute level number to work on */ - Blob hint = {0, 0, 0}; /* Hint read from %_stat table */ - int bDirtyHint = 0; /* True if blob 'hint' has been modified */ - - /* Allocate space for the cursor, filter and writer objects */ - const int nAlloc = sizeof(*pCsr) + sizeof(*pFilter) + sizeof(*pWriter); - pWriter = (IncrmergeWriter *)sqlite3_malloc(nAlloc); - if( !pWriter ) return SQLITE_NOMEM; - pFilter = (Fts3SegFilter *)&pWriter[1]; - pCsr = (Fts3MultiSegReader *)&pFilter[1]; - - rc = fts3IncrmergeHintLoad(p, &hint); - while( rc==SQLITE_OK && nRem>0 ){ - const i64 nMod = FTS3_SEGDIR_MAXLEVEL * p->nIndex; - sqlite3_stmt *pFindLevel = 0; /* SQL used to determine iAbsLevel */ - int bUseHint = 0; /* True if attempting to append */ - - /* Search the %_segdir table for the absolute level with the smallest - ** relative level number that contains at least nMin segments, if any. - ** If one is found, set iAbsLevel to the absolute level number and - ** nSeg to nMin. If no level with at least nMin segments can be found, - ** set nSeg to -1. - */ - rc = fts3SqlStmt(p, SQL_FIND_MERGE_LEVEL, &pFindLevel, 0); - sqlite3_bind_int(pFindLevel, 1, nMin); - if( sqlite3_step(pFindLevel)==SQLITE_ROW ){ - iAbsLevel = sqlite3_column_int64(pFindLevel, 0); - nSeg = nMin; - }else{ - nSeg = -1; - } - rc = sqlite3_reset(pFindLevel); - - /* If the hint read from the %_stat table is not empty, check if the - ** last entry in it specifies a relative level smaller than or equal - ** to the level identified by the block above (if any). If so, this - ** iteration of the loop will work on merging at the hinted level. - */ - if( rc==SQLITE_OK && hint.n ){ - int nHint = hint.n; - sqlite3_int64 iHintAbsLevel = 0; /* Hint level */ - int nHintSeg = 0; /* Hint number of segments */ - - rc = fts3IncrmergeHintPop(&hint, &iHintAbsLevel, &nHintSeg); - if( nSeg<0 || (iAbsLevel % nMod) >= (iHintAbsLevel % nMod) ){ - iAbsLevel = iHintAbsLevel; - nSeg = nHintSeg; - bUseHint = 1; - bDirtyHint = 1; - }else{ - /* This undoes the effect of the HintPop() above - so that no entry - ** is removed from the hint blob. */ - hint.n = nHint; - } - } - - /* If nSeg is less that zero, then there is no level with at least - ** nMin segments and no hint in the %_stat table. No work to do. - ** Exit early in this case. */ - if( nSeg<0 ) break; - - /* Open a cursor to iterate through the contents of the oldest nSeg - ** indexes of absolute level iAbsLevel. If this cursor is opened using - ** the 'hint' parameters, it is possible that there are less than nSeg - ** segments available in level iAbsLevel. In this case, no work is - ** done on iAbsLevel - fall through to the next iteration of the loop - ** to start work on some other level. */ - memset(pWriter, 0, nAlloc); - pFilter->flags = FTS3_SEGMENT_REQUIRE_POS; - if( rc==SQLITE_OK ){ - rc = fts3IncrmergeCsr(p, iAbsLevel, nSeg, pCsr); - } - if( SQLITE_OK==rc && pCsr->nSegment==nSeg - && SQLITE_OK==(rc = sqlite3Fts3SegReaderStart(p, pCsr, pFilter)) - && SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, pCsr)) - ){ - int iIdx = 0; /* Largest idx in level (iAbsLevel+1) */ - rc = fts3IncrmergeOutputIdx(p, iAbsLevel, &iIdx); - if( rc==SQLITE_OK ){ - if( bUseHint && iIdx>0 ){ - const char *zKey = pCsr->zTerm; - int nKey = pCsr->nTerm; - rc = fts3IncrmergeLoad(p, iAbsLevel, iIdx-1, zKey, nKey, pWriter); - }else{ - rc = fts3IncrmergeWriter(p, iAbsLevel, iIdx, pCsr, pWriter); - } - } - - if( rc==SQLITE_OK && pWriter->nLeafEst ){ - fts3LogMerge(nSeg, iAbsLevel); - do { - rc = fts3IncrmergeAppend(p, pWriter, pCsr); - if( rc==SQLITE_OK ) rc = sqlite3Fts3SegReaderStep(p, pCsr); - if( pWriter->nWork>=nRem && rc==SQLITE_ROW ) rc = SQLITE_OK; - }while( rc==SQLITE_ROW ); - - /* Update or delete the input segments */ - if( rc==SQLITE_OK ){ - nRem -= (1 + pWriter->nWork); - rc = fts3IncrmergeChomp(p, iAbsLevel, pCsr, &nSeg); - if( nSeg!=0 ){ - bDirtyHint = 1; - fts3IncrmergeHintPush(&hint, iAbsLevel, nSeg, &rc); - } - } - } - - fts3IncrmergeRelease(p, pWriter, &rc); - } - - sqlite3Fts3SegReaderFinish(pCsr); - } - - /* Write the hint values into the %_stat table for the next incr-merger */ - if( bDirtyHint && rc==SQLITE_OK ){ - rc = fts3IncrmergeHintStore(p, &hint); - } - - sqlite3_free(pWriter); - sqlite3_free(hint.a); - return rc; -} - -/* -** Convert the text beginning at *pz into an integer and return -** its value. Advance *pz to point to the first character past -** the integer. -*/ -static int fts3Getint(const char **pz){ - const char *z = *pz; - int i = 0; - while( (*z)>='0' && (*z)<='9' ) i = 10*i + *(z++) - '0'; - *pz = z; - return i; -} - -/* -** Process statements of the form: -** -** INSERT INTO table(table) VALUES('merge=A,B'); -** -** A and B are integers that decode to be the number of leaf pages -** written for the merge, and the minimum number of segments on a level -** before it will be selected for a merge, respectively. -*/ -static int fts3DoIncrmerge( - Fts3Table *p, /* FTS3 table handle */ - const char *zParam /* Nul-terminated string containing "A,B" */ -){ - int rc; - int nMin = (FTS3_MERGE_COUNT / 2); - int nMerge = 0; - const char *z = zParam; - - /* Read the first integer value */ - nMerge = fts3Getint(&z); - - /* If the first integer value is followed by a ',', read the second - ** integer value. */ - if( z[0]==',' && z[1]!='\0' ){ - z++; - nMin = fts3Getint(&z); - } - - if( z[0]!='\0' || nMin<2 ){ - rc = SQLITE_ERROR; - }else{ - rc = SQLITE_OK; - if( !p->bHasStat ){ - assert( p->bFts4==0 ); - sqlite3Fts3CreateStatTable(&rc, p); - } - if( rc==SQLITE_OK ){ - rc = sqlite3Fts3Incrmerge(p, nMerge, nMin); - } - sqlite3Fts3SegmentsClose(p); - } - return rc; -} - -/* -** Process statements of the form: -** -** INSERT INTO table(table) VALUES('automerge=X'); -** -** where X is an integer. X==0 means to turn automerge off. X!=0 means -** turn it on. The setting is persistent. -*/ -static int fts3DoAutoincrmerge( - Fts3Table *p, /* FTS3 table handle */ - const char *zParam /* Nul-terminated string containing boolean */ -){ - int rc = SQLITE_OK; - sqlite3_stmt *pStmt = 0; - p->bAutoincrmerge = fts3Getint(&zParam)!=0; - if( !p->bHasStat ){ - assert( p->bFts4==0 ); - sqlite3Fts3CreateStatTable(&rc, p); - if( rc ) return rc; - } - rc = fts3SqlStmt(p, SQL_REPLACE_STAT, &pStmt, 0); - if( rc ) return rc;; - sqlite3_bind_int(pStmt, 1, FTS_STAT_AUTOINCRMERGE); - sqlite3_bind_int(pStmt, 2, p->bAutoincrmerge); - sqlite3_step(pStmt); - rc = sqlite3_reset(pStmt); - return rc; -} - -/* -** Return a 64-bit checksum for the FTS index entry specified by the -** arguments to this function. -*/ -static u64 fts3ChecksumEntry( - const char *zTerm, /* Pointer to buffer containing term */ - int nTerm, /* Size of zTerm in bytes */ - int iLangid, /* Language id for current row */ - int iIndex, /* Index (0..Fts3Table.nIndex-1) */ - i64 iDocid, /* Docid for current row. */ - int iCol, /* Column number */ - int iPos /* Position */ -){ - int i; - u64 ret = (u64)iDocid; - - ret += (ret<<3) + iLangid; - ret += (ret<<3) + iIndex; - ret += (ret<<3) + iCol; - ret += (ret<<3) + iPos; - for(i=0; inIndex-1) */ - int *pRc /* OUT: Return code */ -){ - Fts3SegFilter filter; - Fts3MultiSegReader csr; - int rc; - u64 cksum = 0; - - assert( *pRc==SQLITE_OK ); - - memset(&filter, 0, sizeof(filter)); - memset(&csr, 0, sizeof(csr)); - filter.flags = FTS3_SEGMENT_REQUIRE_POS|FTS3_SEGMENT_IGNORE_EMPTY; - filter.flags |= FTS3_SEGMENT_SCAN; - - rc = sqlite3Fts3SegReaderCursor( - p, iLangid, iIndex, FTS3_SEGCURSOR_ALL, 0, 0, 0, 1,&csr - ); - if( rc==SQLITE_OK ){ - rc = sqlite3Fts3SegReaderStart(p, &csr, &filter); - } - - if( rc==SQLITE_OK ){ - while( SQLITE_ROW==(rc = sqlite3Fts3SegReaderStep(p, &csr)) ){ - char *pCsr = csr.aDoclist; - char *pEnd = &pCsr[csr.nDoclist]; - - i64 iDocid = 0; - i64 iCol = 0; - i64 iPos = 0; - - pCsr += sqlite3Fts3GetVarint(pCsr, &iDocid); - while( pCsrnIndex); - while( rc==SQLITE_OK && sqlite3_step(pAllLangid)==SQLITE_ROW ){ - int iLangid = sqlite3_column_int(pAllLangid, 0); - int i; - for(i=0; inIndex; i++){ - cksum1 = cksum1 ^ fts3ChecksumIndex(p, iLangid, i, &rc); - } - } - rc2 = sqlite3_reset(pAllLangid); - if( rc==SQLITE_OK ) rc = rc2; - } - - /* This block calculates the checksum according to the %_content table */ - rc = fts3SqlStmt(p, SQL_SELECT_ALL_LANGID, &pAllLangid, 0); - if( rc==SQLITE_OK ){ - sqlite3_tokenizer_module const *pModule = p->pTokenizer->pModule; - sqlite3_stmt *pStmt = 0; - char *zSql; - - zSql = sqlite3_mprintf("SELECT %s" , p->zReadExprlist); - if( !zSql ){ - rc = SQLITE_NOMEM; - }else{ - rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); - sqlite3_free(zSql); - } - - while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ - i64 iDocid = sqlite3_column_int64(pStmt, 0); - int iLang = langidFromSelect(p, pStmt); - int iCol; - - for(iCol=0; rc==SQLITE_OK && iColnColumn; iCol++){ - const char *zText = (const char *)sqlite3_column_text(pStmt, iCol+1); - int nText = sqlite3_column_bytes(pStmt, iCol+1); - sqlite3_tokenizer_cursor *pT = 0; - - rc = sqlite3Fts3OpenTokenizer(p->pTokenizer, iLang, zText, nText, &pT); - while( rc==SQLITE_OK ){ - char const *zToken; /* Buffer containing token */ - int nToken; /* Number of bytes in token */ - int iDum1, iDum2; /* Dummy variables */ - int iPos; /* Position of token in zText */ - - rc = pModule->xNext(pT, &zToken, &nToken, &iDum1, &iDum2, &iPos); - if( rc==SQLITE_OK ){ - int i; - cksum2 = cksum2 ^ fts3ChecksumEntry( - zToken, nToken, iLang, 0, iDocid, iCol, iPos - ); - for(i=1; inIndex; i++){ - if( p->aIndex[i].nPrefix<=nToken ){ - cksum2 = cksum2 ^ fts3ChecksumEntry( - zToken, p->aIndex[i].nPrefix, iLang, i, iDocid, iCol, iPos - ); - } - } - } - } - if( pT ) pModule->xClose(pT); - if( rc==SQLITE_DONE ) rc = SQLITE_OK; - } - } - - sqlite3_finalize(pStmt); - } - - *pbOk = (cksum1==cksum2); - return rc; -} - -/* -** Run the integrity-check. If no error occurs and the current contents of -** the FTS index are correct, return SQLITE_OK. Or, if the contents of the -** FTS index are incorrect, return SQLITE_CORRUPT_VTAB. -** -** Or, if an error (e.g. an OOM or IO error) occurs, return an SQLite -** error code. -** -** The integrity-check works as follows. For each token and indexed token -** prefix in the document set, a 64-bit checksum is calculated (by code -** in fts3ChecksumEntry()) based on the following: -** -** + The index number (0 for the main index, 1 for the first prefix -** index etc.), -** + The token (or token prefix) text itself, -** + The language-id of the row it appears in, -** + The docid of the row it appears in, -** + The column it appears in, and -** + The tokens position within that column. -** -** The checksums for all entries in the index are XORed together to create -** a single checksum for the entire index. -** -** The integrity-check code calculates the same checksum in two ways: -** -** 1. By scanning the contents of the FTS index, and -** 2. By scanning and tokenizing the content table. -** -** If the two checksums are identical, the integrity-check is deemed to have -** passed. -*/ -static int fts3DoIntegrityCheck( - Fts3Table *p /* FTS3 table handle */ -){ - int rc; - int bOk = 0; - rc = fts3IntegrityCheck(p, &bOk); - if( rc==SQLITE_OK && bOk==0 ) rc = SQLITE_CORRUPT_VTAB; - return rc; -} - /* ** Handle a 'special' INSERT of the form: ** ** "INSERT INTO tbl(tbl) VALUES()" ** @@ -130683,16 +127712,10 @@ return SQLITE_NOMEM; }else if( nVal==8 && 0==sqlite3_strnicmp(zVal, "optimize", 8) ){ rc = fts3DoOptimize(p, 0); }else if( nVal==7 && 0==sqlite3_strnicmp(zVal, "rebuild", 7) ){ rc = fts3DoRebuild(p); - }else if( nVal==15 && 0==sqlite3_strnicmp(zVal, "integrity-check", 15) ){ - rc = fts3DoIntegrityCheck(p); - }else if( nVal>6 && 0==sqlite3_strnicmp(zVal, "merge=", 6) ){ - rc = fts3DoIncrmerge(p, &zVal[6]); - }else if( nVal>10 && 0==sqlite3_strnicmp(zVal, "automerge=", 10) ){ - rc = fts3DoAutoincrmerge(p, &zVal[10]); #ifdef SQLITE_TEST }else if( nVal>9 && 0==sqlite3_strnicmp(zVal, "nodesize=", 9) ){ p->nNodeSize = atoi(&zVal[9]); rc = SQLITE_OK; }else if( nVal>11 && 0==sqlite3_strnicmp(zVal, "maxpending=", 9) ){ @@ -130757,17 +127780,18 @@ for(i=0; inColumn && rc==SQLITE_OK; i++){ const char *zText = (const char *)sqlite3_column_text(pCsr->pStmt, i+1); sqlite3_tokenizer_cursor *pTC = 0; - rc = sqlite3Fts3OpenTokenizer(pT, pCsr->iLangid, zText, -1, &pTC); + rc = pModule->xOpen(pT, zText, -1, &pTC); while( rc==SQLITE_OK ){ char const *zToken; /* Buffer containing token */ int nToken; /* Number of bytes in token */ int iDum1, iDum2; /* Dummy variables */ int iPos; /* Position of token in zText */ + pTC->pTokenizer = pT; rc = pModule->xNext(pTC, &zToken, &nToken, &iDum1, &iDum2, &iPos); for(pDef=pCsr->pDeferred; pDef && rc==SQLITE_OK; pDef=pDef->pNext){ Fts3PhraseToken *pPT = pDef->pToken; if( (pDef->iCol>=p->nColumn || pDef->iCol==i) && (pPT->bFirst==0 || iPos==0) @@ -130863,10 +127887,12 @@ ** delete the contents of all three tables and throw away any ** data in the pendingTerms hash table. */ rc = fts3DeleteAll(p, 1); *pnDoc = *pnDoc - 1; }else{ + sqlite3_int64 iRemove = sqlite3_value_int64(pRowid); + rc = fts3PendingTermsDocid(p, iRemove); fts3DeleteTerms(&rc, p, pRowid, aSzDel); if( p->zContentTbl==0 ){ fts3SqlExec(&rc, p, SQL_DELETE_CONTENT, &pRowid); if( sqlite3_changes(p->db) ) *pnDoc = *pnDoc - 1; }else{ @@ -130881,20 +127907,11 @@ return rc; } /* ** This function does the work for the xUpdate method of FTS3 virtual -** tables. The schema of the virtual table being: -** -** CREATE TABLE ( -** , -**
    HIDDEN, -** docid HIDDEN, -** HIDDEN -** ); -** -** +** tables. */ SQLITE_PRIVATE int sqlite3Fts3UpdateMethod( sqlite3_vtab *pVtab, /* FTS3 vtab object */ int nArg, /* Size of argument array */ sqlite3_value **apVal, /* Array of arguments */ @@ -130907,14 +127924,10 @@ u32 *aSzDel; /* Sizes of deleted documents */ int nChng = 0; /* Net change in number of documents */ int bInsertDone = 0; assert( p->pSegments==0 ); - assert( - nArg==1 /* DELETE operations */ - || nArg==(2 + p->nColumn + 3) /* INSERT or UPDATE operations */ - ); /* Check for a "special" INSERT operation. One of the form: ** ** INSERT INTO xyz(xyz) VALUES('command'); */ @@ -130924,15 +127937,10 @@ ){ rc = fts3SpecialInsert(p, apVal[p->nColumn+2]); goto update_out; } - if( nArg>1 && sqlite3_value_int(apVal[2 + p->nColumn + 2])<0 ){ - rc = SQLITE_CONSTRAINT; - goto update_out; - } - /* Allocate space to hold the change in document sizes */ aSzIns = sqlite3_malloc( sizeof(aSzIns[0])*(p->nColumn+1)*2 ); if( aSzIns==0 ){ rc = SQLITE_NOMEM; goto update_out; @@ -130996,31 +128004,30 @@ isRemove = 1; } /* If this is an INSERT or UPDATE operation, insert the new record. */ if( nArg>1 && rc==SQLITE_OK ){ - int iLangid = sqlite3_value_int(apVal[2 + p->nColumn + 2]); if( bInsertDone==0 ){ rc = fts3InsertData(p, apVal, pRowid); if( rc==SQLITE_CONSTRAINT && p->zContentTbl==0 ){ rc = FTS_CORRUPT_VTAB; } } if( rc==SQLITE_OK && (!isRemove || *pRowid!=p->iPrevDocid ) ){ - rc = fts3PendingTermsDocid(p, iLangid, *pRowid); + rc = fts3PendingTermsDocid(p, *pRowid); } if( rc==SQLITE_OK ){ assert( p->iPrevDocid==*pRowid ); - rc = fts3InsertTerms(p, iLangid, apVal, aSzIns); + rc = fts3InsertTerms(p, apVal, aSzIns); } if( p->bHasDocsize ){ fts3InsertDocsize(&rc, p, aSzIns); } nChng++; } - if( p->bFts4 ){ + if( p->bHasStat ){ fts3UpdateDocTotals(&rc, p, aSzIns, aSzDel, nChng); } update_out: sqlite3_free(aSzIns); @@ -131413,15 +128420,14 @@ */ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){ SnippetIter *p = (SnippetIter *)ctx; SnippetPhrase *pPhrase = &p->aPhrase[iPhrase]; char *pCsr; - int rc; pPhrase->nToken = pExpr->pPhrase->nToken; - rc = sqlite3Fts3EvalPhrasePoslist(p->pCsr, pExpr, p->iCol, &pCsr); - assert( rc==SQLITE_OK || pCsr==0 ); + + pCsr = sqlite3Fts3EvalPhrasePoslist(p->pCsr, pExpr, p->iCol); if( pCsr ){ int iFirst = 0; pPhrase->pList = pCsr; fts3GetDeltaPosition(&pCsr, &iFirst); assert( iFirst>=0 ); @@ -131428,16 +128434,14 @@ pPhrase->pHead = pCsr; pPhrase->pTail = pCsr; pPhrase->iHead = iFirst; pPhrase->iTail = iFirst; }else{ - assert( rc!=SQLITE_OK || ( - pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 - )); + assert( pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0 ); } - return rc; + return SQLITE_OK; } /* ** Select the fragment of text consisting of nFragment contiguous tokens ** from column iCol that represent the "best" snippet. The best snippet @@ -131588,11 +128592,10 @@ ** is no way for fts3BestSnippet() to know whether or not the document ** actually contains terms that follow the final highlighted term. */ static int fts3SnippetShift( Fts3Table *pTab, /* FTS3 table snippet comes from */ - int iLangid, /* Language id to use in tokenizing */ int nSnippet, /* Number of tokens desired for snippet */ const char *zDoc, /* Document text to extract snippet from */ int nDoc, /* Size of buffer zDoc in bytes */ int *piPos, /* IN/OUT: First token of snippet */ u64 *pHlmask /* IN/OUT: Mask of tokens to highlight */ @@ -131624,14 +128627,15 @@ pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; /* Open a cursor on zDoc/nDoc. Check if there are (nSnippet+nDesired) ** or more tokens in zDoc/nDoc. */ - rc = sqlite3Fts3OpenTokenizer(pTab->pTokenizer, iLangid, zDoc, nDoc, &pC); + rc = pMod->xOpen(pTab->pTokenizer, zDoc, nDoc, &pC); if( rc!=SQLITE_OK ){ return rc; } + pC->pTokenizer = pTab->pTokenizer; while( rc==SQLITE_OK && iCurrent<(nSnippet+nDesired) ){ const char *ZDUMMY; int DUMMY1, DUMMY2, DUMMY3; rc = pMod->xNext(pC, &ZDUMMY, &DUMMY1, &DUMMY2, &DUMMY3, &iCurrent); } pMod->xClose(pC); @@ -131687,14 +128691,15 @@ } nDoc = sqlite3_column_bytes(pCsr->pStmt, iCol); /* Open a token cursor on the document. */ pMod = (sqlite3_tokenizer_module *)pTab->pTokenizer->pModule; - rc = sqlite3Fts3OpenTokenizer(pTab->pTokenizer, pCsr->iLangid, zDoc,nDoc,&pC); + rc = pMod->xOpen(pTab->pTokenizer, zDoc, nDoc, &pC); if( rc!=SQLITE_OK ){ return rc; } + pC->pTokenizer = pTab->pTokenizer; while( rc==SQLITE_OK ){ int iBegin; /* Offset in zDoc of start of token */ int iFin; /* Offset in zDoc of end of token */ int isHighlight; /* True for highlighted terms */ @@ -131712,13 +128717,11 @@ } if( iCurrentiLangid, nSnippet, &zDoc[iBegin], n, &iPos, &hlmask - ); + rc = fts3SnippetShift(pTab, nSnippet, &zDoc[iBegin], n, &iPos, &hlmask); isShiftDone = 1; /* Now that the shift has been done, check if the initial "..." are ** required. They are required if (a) this is not the first fragment, ** or (b) this fragment does not begin at position 0 of its column. @@ -131826,37 +128829,36 @@ static int fts3ExprLocalHitsCb( Fts3Expr *pExpr, /* Phrase expression node */ int iPhrase, /* Phrase number */ void *pCtx /* Pointer to MatchInfo structure */ ){ - int rc = SQLITE_OK; MatchInfo *p = (MatchInfo *)pCtx; int iStart = iPhrase * p->nCol * 3; int i; - for(i=0; inCol && rc==SQLITE_OK; i++){ + for(i=0; inCol; i++){ char *pCsr; - rc = sqlite3Fts3EvalPhrasePoslist(p->pCursor, pExpr, i, &pCsr); + pCsr = sqlite3Fts3EvalPhrasePoslist(p->pCursor, pExpr, i); if( pCsr ){ p->aMatchinfo[iStart+i*3] = fts3ColumnlistCount(&pCsr); }else{ p->aMatchinfo[iStart+i*3] = 0; } } - return rc; + return SQLITE_OK; } static int fts3MatchinfoCheck( Fts3Table *pTab, char cArg, char **pzErr ){ if( (cArg==FTS3_MATCHINFO_NPHRASE) || (cArg==FTS3_MATCHINFO_NCOL) - || (cArg==FTS3_MATCHINFO_NDOC && pTab->bFts4) - || (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bFts4) + || (cArg==FTS3_MATCHINFO_NDOC && pTab->bHasStat) + || (cArg==FTS3_MATCHINFO_AVGLENGTH && pTab->bHasStat) || (cArg==FTS3_MATCHINFO_LENGTH && pTab->bHasDocsize) || (cArg==FTS3_MATCHINFO_LCS) || (cArg==FTS3_MATCHINFO_HITS) ){ return SQLITE_OK; @@ -132002,14 +129004,12 @@ for(iCol=0; iColnCol; iCol++){ int nLcs = 0; /* LCS value for this column */ int nLive = 0; /* Number of iterators in aIter not at EOF */ for(i=0; inPhrase; i++){ - int rc; LcsIterator *pIt = &aIter[i]; - rc = sqlite3Fts3EvalPhrasePoslist(pCsr, pIt->pExpr, iCol, &pIt->pRead); - if( rc!=SQLITE_OK ) return rc; + pIt->pRead = sqlite3Fts3EvalPhrasePoslist(pCsr, pIt->pExpr, iCol); if( pIt->pRead ){ pIt->iPos = pIt->iPosOffset; fts3LcsIteratorAdvance(&aIter[i]); nLive++; } @@ -132357,14 +129357,13 @@ TermOffsetCtx *p = (TermOffsetCtx *)ctx; int nTerm; /* Number of tokens in phrase */ int iTerm; /* For looping through nTerm phrase terms */ char *pList; /* Pointer to position list for phrase */ int iPos = 0; /* First position in position-list */ - int rc; UNUSED_PARAMETER(iPhrase); - rc = sqlite3Fts3EvalPhrasePoslist(p->pCsr, pExpr, p->iCol, &pList); + pList = sqlite3Fts3EvalPhrasePoslist(p->pCsr, pExpr, p->iCol); nTerm = pExpr->pPhrase->nToken; if( pList ){ fts3GetDeltaPosition(&pList, &iPos); assert( iPos>=0 ); } @@ -132374,11 +129373,11 @@ pT->iOff = nTerm-iTerm-1; pT->pList = pList; pT->iPos = iPos; } - return rc; + return SQLITE_OK; } /* ** Implementation of offsets() function. */ @@ -132451,14 +129450,13 @@ rc = SQLITE_NOMEM; goto offsets_out; } /* Initialize a tokenizer iterator to iterate through column iCol. */ - rc = sqlite3Fts3OpenTokenizer(pTab->pTokenizer, pCsr->iLangid, - zDoc, nDoc, &pC - ); + rc = pMod->xOpen(pTab->pTokenizer, zDoc, nDoc, &pC); if( rc!=SQLITE_OK ) goto offsets_out; + pC->pTokenizer = pTab->pTokenizer; rc = pMod->xNext(pC, &ZDUMMY, &NDUMMY, &iStart, &iEnd, &iCurrent); while( rc==SQLITE_OK ){ int i; /* Used to loop through terms */ int iMinPos = 0x7FFFFFFF; /* Position of next token */ @@ -132745,23 +129743,10 @@ /* Possible values for eCoordType: */ #define RTREE_COORD_REAL32 0 #define RTREE_COORD_INT32 1 -/* -** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -** only deal with integer coordinates. No floating point operations -** will be done. -*/ -#ifdef SQLITE_RTREE_INT_ONLY - typedef sqlite3_int64 RtreeDValue; /* High accuracy coordinate */ - typedef int RtreeValue; /* Low accuracy coordinate */ -#else - typedef double RtreeDValue; /* High accuracy coordinate */ - typedef float RtreeValue; /* Low accuracy coordinate */ -#endif - /* ** The minimum number of cells allowed for a node is a third of the ** maximum. In Gutman's notation: ** ** m = M/3 @@ -132793,38 +129778,33 @@ int nConstraint; /* Number of entries in aConstraint */ RtreeConstraint *aConstraint; /* Search constraints. */ }; union RtreeCoord { - RtreeValue f; + float f; int i; }; /* ** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. +** formatted as a double. This macro assumes that local variable pRtree points +** to the Rtree structure associated with the RtreeCoord. */ -#ifdef SQLITE_RTREE_INT_ONLY -# define DCOORD(coord) ((RtreeDValue)coord.i) -#else -# define DCOORD(coord) ( \ - (pRtree->eCoordType==RTREE_COORD_REAL32) ? \ - ((double)coord.f) : \ - ((double)coord.i) \ - ) -#endif +#define DCOORD(coord) ( \ + (pRtree->eCoordType==RTREE_COORD_REAL32) ? \ + ((double)coord.f) : \ + ((double)coord.i) \ +) /* ** A search constraint. */ struct RtreeConstraint { int iCoord; /* Index of constrained coordinate */ int op; /* Constraining operation */ - RtreeDValue rValue; /* Constraint value. */ - int (*xGeom)(sqlite3_rtree_geometry*, int, RtreeDValue*, int*); + double rValue; /* Constraint value. */ + int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *); sqlite3_rtree_geometry *pGeom; /* Constraint callback argument for a MATCH */ }; /* Possible values for RtreeConstraint.op */ #define RTREE_EQ 0x41 @@ -132868,14 +129848,14 @@ ** the right-hand-side of an SQL MATCH operator used to constrain an ** r-tree query. */ struct RtreeMatchArg { u32 magic; /* Always RTREE_GEOMETRY_MAGIC */ - int (*xGeom)(sqlite3_rtree_geometry *, int, RtreeDValue*, int *); + int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *); void *pContext; int nParam; - RtreeDValue aParam[1]; + double aParam[1]; }; /* ** When a geometry callback is created (see sqlite3_rtree_geometry_callback), ** a single instance of the following structure is allocated. It is used @@ -132883,11 +129863,11 @@ ** is eventually deleted by the destructor mechanism provided by ** sqlite3_create_function_v2() (which is called by s_r_g_c() to create ** the geometry callback function). */ struct RtreeGeomCallback { - int (*xGeom)(sqlite3_rtree_geometry*, int, RtreeDValue*, int*); + int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *); void *pContext; }; #ifndef MAX # define MAX(x,y) ((x) < (y) ? (y) : (x)) @@ -133449,11 +130429,11 @@ RtreeConstraint *pConstraint, /* MATCH constraint to test */ RtreeCell *pCell, /* Cell to test */ int *pbRes /* OUT: Test result */ ){ int i; - RtreeDValue aCoord[RTREE_MAX_DIMENSIONS*2]; + double aCoord[RTREE_MAX_DIMENSIONS*2]; int nCoord = pRtree->nDim*2; assert( pConstraint->op==RTREE_MATCH ); assert( pConstraint->pGeom ); @@ -133479,12 +130459,12 @@ int rc = SQLITE_OK; nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell); for(ii=0; bRes==0 && iinConstraint; ii++){ RtreeConstraint *p = &pCursor->aConstraint[ii]; - RtreeDValue cell_min = DCOORD(cell.aCoord[(p->iCoord>>1)*2]); - RtreeDValue cell_max = DCOORD(cell.aCoord[(p->iCoord>>1)*2+1]); + double cell_min = DCOORD(cell.aCoord[(p->iCoord>>1)*2]); + double cell_max = DCOORD(cell.aCoord[(p->iCoord>>1)*2+1]); assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_MATCH ); @@ -133532,11 +130512,11 @@ *pbEof = 0; nodeGetCell(pRtree, pCursor->pNode, pCursor->iCell, &cell); for(ii=0; iinConstraint; ii++){ RtreeConstraint *p = &pCursor->aConstraint[ii]; - RtreeDValue coord = DCOORD(cell.aCoord[p->iCoord]); + double coord = DCOORD(cell.aCoord[p->iCoord]); int res; assert(p->op==RTREE_LE || p->op==RTREE_LT || p->op==RTREE_GE || p->op==RTREE_GT || p->op==RTREE_EQ || p->op==RTREE_MATCH ); switch( p->op ){ @@ -133730,16 +130710,13 @@ i64 iRowid = nodeGetRowid(pRtree, pCsr->pNode, pCsr->iCell); sqlite3_result_int64(ctx, iRowid); }else{ RtreeCoord c; nodeGetCoord(pRtree, pCsr->pNode, pCsr->iCell, i-1, &c); -#ifndef SQLITE_RTREE_INT_ONLY if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ sqlite3_result_double(ctx, c.f); - }else -#endif - { + }else{ assert( pRtree->eCoordType==RTREE_COORD_INT32 ); sqlite3_result_int(ctx, c.i); } } @@ -133782,11 +130759,11 @@ if( sqlite3_value_type(pValue)!=SQLITE_BLOB ) return SQLITE_ERROR; /* Check that the blob is roughly the right size. */ nBlob = sqlite3_value_bytes(pValue); if( nBlob<(int)sizeof(RtreeMatchArg) - || ((nBlob-sizeof(RtreeMatchArg))%sizeof(RtreeDValue))!=0 + || ((nBlob-sizeof(RtreeMatchArg))%sizeof(double))!=0 ){ return SQLITE_ERROR; } pGeom = (sqlite3_rtree_geometry *)sqlite3_malloc( @@ -133796,11 +130773,11 @@ memset(pGeom, 0, sizeof(sqlite3_rtree_geometry)); p = (RtreeMatchArg *)&pGeom[1]; memcpy(p, sqlite3_value_blob(pValue), nBlob); if( p->magic!=RTREE_GEOMETRY_MAGIC - || nBlob!=(int)(sizeof(RtreeMatchArg) + (p->nParam-1)*sizeof(RtreeDValue)) + || nBlob!=(int)(sizeof(RtreeMatchArg) + (p->nParam-1)*sizeof(double)) ){ sqlite3_free(pGeom); return SQLITE_ERROR; } @@ -133868,15 +130845,11 @@ rc = deserializeGeometry(argv[ii], p); if( rc!=SQLITE_OK ){ break; } }else{ -#ifdef SQLITE_RTREE_INT_ONLY - p->rValue = sqlite3_value_int64(argv[ii]); -#else p->rValue = sqlite3_value_double(argv[ii]); -#endif } } } } @@ -134006,28 +130979,28 @@ } /* ** Return the N-dimensional volumn of the cell stored in *p. */ -static RtreeDValue cellArea(Rtree *pRtree, RtreeCell *p){ - RtreeDValue area = (RtreeDValue)1; +static float cellArea(Rtree *pRtree, RtreeCell *p){ + float area = 1.0; int ii; for(ii=0; ii<(pRtree->nDim*2); ii+=2){ - area = (area * (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]))); + area = (float)(area * (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii]))); } return area; } /* ** Return the margin length of cell p. The margin length is the sum ** of the objects size in each dimension. */ -static RtreeDValue cellMargin(Rtree *pRtree, RtreeCell *p){ - RtreeDValue margin = (RtreeDValue)0; +static float cellMargin(Rtree *pRtree, RtreeCell *p){ + float margin = 0.0; int ii; for(ii=0; ii<(pRtree->nDim*2); ii+=2){ - margin += (DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii])); + margin += (float)(DCOORD(p->aCoord[ii+1]) - DCOORD(p->aCoord[ii])); } return margin; } /* @@ -134068,50 +131041,51 @@ } /* ** Return the amount cell p would grow by if it were unioned with pCell. */ -static RtreeDValue cellGrowth(Rtree *pRtree, RtreeCell *p, RtreeCell *pCell){ - RtreeDValue area; +static float cellGrowth(Rtree *pRtree, RtreeCell *p, RtreeCell *pCell){ + float area; RtreeCell cell; memcpy(&cell, p, sizeof(RtreeCell)); area = cellArea(pRtree, &cell); cellUnion(pRtree, &cell, pCell); return (cellArea(pRtree, &cell)-area); } #if VARIANT_RSTARTREE_CHOOSESUBTREE || VARIANT_RSTARTREE_SPLIT -static RtreeDValue cellOverlap( +static float cellOverlap( Rtree *pRtree, RtreeCell *p, RtreeCell *aCell, int nCell, int iExclude ){ int ii; - RtreeDValue overlap = 0.0; + float overlap = 0.0; for(ii=0; iinDim*2); jj+=2){ - RtreeDValue x1, x2; + double x1; + double x2; x1 = MAX(DCOORD(p->aCoord[jj]), DCOORD(aCell[ii].aCoord[jj])); x2 = MIN(DCOORD(p->aCoord[jj+1]), DCOORD(aCell[ii].aCoord[jj+1])); if( x2iDepth-iHeight); ii++){ int iCell; sqlite3_int64 iBest = 0; - RtreeDValue fMinGrowth = 0.0; - RtreeDValue fMinArea = 0.0; + float fMinGrowth = 0.0; + float fMinArea = 0.0; #if VARIANT_RSTARTREE_CHOOSESUBTREE - RtreeDValue fMinOverlap = 0.0; - RtreeDValue overlap; + float fMinOverlap = 0.0; + float overlap; #endif int nCell = NCELL(pNode); RtreeCell cell; RtreeNode *pChild; @@ -134189,12 +131164,12 @@ ** is inserted into it. Resolve ties by choosing the entry with ** the smallest area. */ for(iCell=0; iCellnDim; i++){ - RtreeDValue x1 = DCOORD(aCell[0].aCoord[i*2]); - RtreeDValue x2 = DCOORD(aCell[0].aCoord[i*2+1]); - RtreeDValue x3 = x1; - RtreeDValue x4 = x2; + float x1 = DCOORD(aCell[0].aCoord[i*2]); + float x2 = DCOORD(aCell[0].aCoord[i*2+1]); + float x3 = x1; + float x4 = x2; int jj; int iCellLeft = 0; int iCellRight = 0; for(jj=1; jjx4 ) x4 = right; if( left>x3 ){ x3 = left; @@ -134351,11 +131326,11 @@ iCellLeft = jj; } } if( x4!=x1 ){ - RtreeDValue normalwidth = (x3 - x2) / (x4 - x1); + float normalwidth = (x3 - x2) / (x4 - x1); if( normalwidth>maxNormalInnerWidth ){ iLeftSeed = iCellLeft; iRightSeed = iCellRight; } } @@ -134380,17 +131355,17 @@ int *aiUsed ){ #define FABS(a) ((a)<0.0?-1.0*(a):(a)) int iSelect = -1; - RtreeDValue fDiff; + float fDiff; int ii; for(ii=0; iifDiff ){ fDiff = diff; iSelect = ii; } } @@ -134413,17 +131388,17 @@ int ii; int jj; int iLeftSeed = 0; int iRightSeed = 1; - RtreeDValue fWaste = 0.0; + float fWaste = 0.0; for(ii=0; iifWaste ){ iLeftSeed = ii; iRightSeed = jj; fWaste = waste; @@ -134454,11 +131429,11 @@ ** sorting algorithm. */ static void SortByDistance( int *aIdx, int nIdx, - RtreeDValue *aDistance, + float *aDistance, int *aSpare ){ if( nIdx>1 ){ int iLeft = 0; int iRight = 0; @@ -134480,12 +131455,12 @@ iRight++; }else if( iRight==nRight ){ aIdx[iLeft+iRight] = aLeft[iLeft]; iLeft++; }else{ - RtreeDValue fLeft = aDistance[aLeft[iLeft]]; - RtreeDValue fRight = aDistance[aRight[iRight]]; + float fLeft = aDistance[aLeft[iLeft]]; + float fRight = aDistance[aRight[iRight]]; if( fLeftnDim+1)*(sizeof(int*)+nCell*sizeof(int)); aaSorted = (int **)sqlite3_malloc(nByte); if( !aaSorted ){ @@ -134613,13 +131588,13 @@ } SortByDimension(pRtree, aaSorted[ii], nCell, ii, aCell, aSpare); } for(ii=0; iinDim; ii++){ - RtreeDValue margin = 0.0; - RtreeDValue fBestOverlap = 0.0; - RtreeDValue fBestArea = 0.0; + float margin = 0.0; + float fBestOverlap = 0.0; + float fBestArea = 0.0; int iBestLeft = 0; int nLeft; for( nLeft=RTREE_MINCELLS(pRtree); @@ -134627,12 +131602,12 @@ nLeft++ ){ RtreeCell left; RtreeCell right; int kk; - RtreeDValue overlap; - RtreeDValue area; + float overlap; + float area; memcpy(&left, &aCell[aaSorted[ii][0]], sizeof(RtreeCell)); memcpy(&right, &aCell[aaSorted[ii][nCell-1]], sizeof(RtreeCell)); for(kk=1; kk<(nCell-1); kk++){ if( kk0; i--){ RtreeCell *pNext; pNext = PickNext(pRtree, aCell, nCell, pBboxLeft, pBboxRight, aiUsed); - RtreeDValue diff = + float diff = cellGrowth(pRtree, pBboxLeft, pNext) - cellGrowth(pRtree, pBboxRight, pNext) ; if( (RTREE_MINCELLS(pRtree)-NCELL(pRight)==i) || (diff>0.0 && (RTREE_MINCELLS(pRtree)-NCELL(pLeft)!=i)) @@ -135044,60 +132019,58 @@ int iHeight ){ int *aOrder; int *aSpare; RtreeCell *aCell; - RtreeDValue *aDistance; + float *aDistance; int nCell; - RtreeDValue aCenterCoord[RTREE_MAX_DIMENSIONS]; + float aCenterCoord[RTREE_MAX_DIMENSIONS]; int iDim; int ii; int rc = SQLITE_OK; - int n; - memset(aCenterCoord, 0, sizeof(RtreeDValue)*RTREE_MAX_DIMENSIONS); + memset(aCenterCoord, 0, sizeof(float)*RTREE_MAX_DIMENSIONS); nCell = NCELL(pNode)+1; - n = (nCell+1)&(~1); /* Allocate the buffers used by this operation. The allocation is ** relinquished before this function returns. */ - aCell = (RtreeCell *)sqlite3_malloc(n * ( - sizeof(RtreeCell) + /* aCell array */ - sizeof(int) + /* aOrder array */ - sizeof(int) + /* aSpare array */ - sizeof(RtreeDValue) /* aDistance array */ + aCell = (RtreeCell *)sqlite3_malloc(nCell * ( + sizeof(RtreeCell) + /* aCell array */ + sizeof(int) + /* aOrder array */ + sizeof(int) + /* aSpare array */ + sizeof(float) /* aDistance array */ )); if( !aCell ){ return SQLITE_NOMEM; } - aOrder = (int *)&aCell[n]; - aSpare = (int *)&aOrder[n]; - aDistance = (RtreeDValue *)&aSpare[n]; + aOrder = (int *)&aCell[nCell]; + aSpare = (int *)&aOrder[nCell]; + aDistance = (float *)&aSpare[nCell]; for(ii=0; iinDim; iDim++){ - aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2]); - aCenterCoord[iDim] += DCOORD(aCell[ii].aCoord[iDim*2+1]); + aCenterCoord[iDim] += (float)DCOORD(aCell[ii].aCoord[iDim*2]); + aCenterCoord[iDim] += (float)DCOORD(aCell[ii].aCoord[iDim*2+1]); } } for(iDim=0; iDimnDim; iDim++){ - aCenterCoord[iDim] = (aCenterCoord[iDim]/(nCell*(RtreeDValue)2)); + aCenterCoord[iDim] = (float)(aCenterCoord[iDim]/((float)nCell*2.0)); } for(ii=0; iinDim; iDim++){ - RtreeDValue coord = (DCOORD(aCell[ii].aCoord[iDim*2+1]) - - DCOORD(aCell[ii].aCoord[iDim*2])); + float coord = (float)(DCOORD(aCell[ii].aCoord[iDim*2+1]) - + DCOORD(aCell[ii].aCoord[iDim*2])); aDistance[ii] += (coord-aCenterCoord[iDim])*(coord-aCenterCoord[iDim]); } } SortByDistance(aOrder, nCell, aDistance, aSpare); @@ -135335,23 +132308,20 @@ if( nData>1 ){ int ii; /* Populate the cell.aCoord[] array. The first coordinate is azData[3]. */ assert( nData==(pRtree->nDim*2 + 3) ); -#ifndef SQLITE_RTREE_INT_ONLY if( pRtree->eCoordType==RTREE_COORD_REAL32 ){ for(ii=0; ii<(pRtree->nDim*2); ii+=2){ - cell.aCoord[ii].f = (RtreeValue)sqlite3_value_double(azData[ii+3]); - cell.aCoord[ii+1].f = (RtreeValue)sqlite3_value_double(azData[ii+4]); + cell.aCoord[ii].f = (float)sqlite3_value_double(azData[ii+3]); + cell.aCoord[ii+1].f = (float)sqlite3_value_double(azData[ii+4]); if( cell.aCoord[ii].f>cell.aCoord[ii+1].f ){ rc = SQLITE_CONSTRAINT; goto constraint; } } - }else -#endif - { + }else{ for(ii=0; ii<(pRtree->nDim*2); ii+=2){ cell.aCoord[ii].i = sqlite3_value_int(azData[ii+3]); cell.aCoord[ii+1].i = sqlite3_value_int(azData[ii+4]); if( cell.aCoord[ii].i>cell.aCoord[ii+1].i ){ rc = SQLITE_CONSTRAINT; @@ -135647,12 +132617,12 @@ } sqlite3_vtab_config(db, SQLITE_VTAB_CONSTRAINT_SUPPORT, 1); /* Allocate the sqlite3_vtab structure */ - nDb = (int)strlen(argv[1]); - nName = (int)strlen(argv[2]); + nDb = strlen(argv[1]); + nName = strlen(argv[2]); pRtree = (Rtree *)sqlite3_malloc(sizeof(Rtree)+nDb+nName+2); if( !pRtree ){ return SQLITE_NOMEM; } memset(pRtree, 0, sizeof(Rtree)+nDb+nName+2); @@ -135743,20 +132713,14 @@ RtreeCell cell; int jj; nodeGetCell(&tree, &node, ii, &cell); sqlite3_snprintf(512-nCell,&zCell[nCell],"%lld", cell.iRowid); - nCell = (int)strlen(zCell); + nCell = strlen(zCell); for(jj=0; jjmagic = RTREE_GEOMETRY_MAGIC; pBlob->xGeom = pGeomCtx->xGeom; pBlob->pContext = pGeomCtx->pContext; pBlob->nParam = nArg; for(i=0; iaParam[i] = sqlite3_value_int64(aArg[i]); -#else pBlob->aParam[i] = sqlite3_value_double(aArg[i]); -#endif } sqlite3_result_blob(ctx, pBlob, nBlob, doSqlite3Free); } } @@ -135858,11 +132814,11 @@ ** Register a new geometry function for use with the r-tree MATCH operator. */ SQLITE_API int sqlite3_rtree_geometry_callback( sqlite3 *db, const char *zGeom, - int (*xGeom)(sqlite3_rtree_geometry *, int, RtreeDValue *, int *), + int (*xGeom)(sqlite3_rtree_geometry *, int, double *, int *), void *pContext ){ RtreeGeomCallback *pGeomCtx; /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -136503,14 +133459,11 @@ int iInput = 0; int iOut = 0; *ppCursor = 0; - if( zInput==0 ){ - nInput = 0; - zInput = ""; - }else if( nInput<0 ){ + if( nInput<0 ){ nInput = strlen(zInput); } nChar = nInput+1; pCsr = (IcuCursor *)sqlite3_malloc( sizeof(IcuCursor) + /* IcuCursor */ Index: SQLite.Interop/src/core/sqlite3.h ================================================================== --- SQLite.Interop/src/core/sqlite3.h +++ SQLite.Interop/src/core/sqlite3.h @@ -105,13 +105,13 @@ ** ** See also: [sqlite3_libversion()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.7.12" -#define SQLITE_VERSION_NUMBER 3007012 -#define SQLITE_SOURCE_ID "2012-05-14 01:41:23 8654aa9540fe9fd210899d83d17f3f407096c004" +#define SQLITE_VERSION "3.7.10" +#define SQLITE_VERSION_NUMBER 3007010 +#define SQLITE_SOURCE_ID "2012-01-16 13:28:40 ebd01a8deffb5024a5d7494eef800d2366d97204" /* ** CAPI3REF: Run-Time Library Version Numbers ** KEYWORDS: sqlite3_version, sqlite3_sourceid ** @@ -456,15 +456,13 @@ #define SQLITE_IOERR_SHMMAP (SQLITE_IOERR | (21<<8)) #define SQLITE_IOERR_SEEK (SQLITE_IOERR | (22<<8)) #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) #define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8)) -#define SQLITE_CANTOPEN_ISDIR (SQLITE_CANTOPEN | (2<<8)) #define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8)) #define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8)) #define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8)) -#define SQLITE_ABORT_ROLLBACK (SQLITE_ABORT | (2<<8)) /* ** CAPI3REF: Flags For File Open Operations ** ** These bit values are intended for use in the @@ -716,35 +714,31 @@ ** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], ** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) ** into an integer that the pArg argument points to. This capability ** is used during testing and only needs to be supported when SQLITE_TEST ** is defined. -**
      -**
    • [[SQLITE_FCNTL_SIZE_HINT]] +** ** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS ** layer a hint of how large the database file will grow to be during the ** current transaction. This hint is not guaranteed to be accurate but it ** is often close. The underlying VFS might choose to preallocate database ** file space based on this hint in order to help writes to the database ** file run faster. ** -**
    • [[SQLITE_FCNTL_CHUNK_SIZE]] ** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS ** extends and truncates the database file in chunks of a size specified ** by the user. The fourth argument to [sqlite3_file_control()] should ** point to an integer (type int) containing the new chunk-size to use ** for the nominated database. Allocating database file space in large ** chunks (say 1MB at a time), may reduce file-system fragmentation and ** improve performance on some systems. ** -**
    • [[SQLITE_FCNTL_FILE_POINTER]] ** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer ** to the [sqlite3_file] object associated with a particular database ** connection. See the [sqlite3_file_control()] documentation for ** additional information. ** -**
    • [[SQLITE_FCNTL_SYNC_OMITTED]] ** ^(The [SQLITE_FCNTL_SYNC_OMITTED] opcode is generated internally by ** SQLite and sent to all VFSes in place of a call to the xSync method ** when the database connection has [PRAGMA synchronous] set to OFF.)^ ** Some specialized VFSes need this signal in order to operate correctly ** when [PRAGMA synchronous | PRAGMA synchronous=OFF] is set, but most @@ -751,11 +745,10 @@ ** VFSes do not need this signal and should silently ignore this opcode. ** Applications should not call [sqlite3_file_control()] with this ** opcode as doing so may disrupt the operation of the specialized VFSes ** that do require it. ** -**
    • [[SQLITE_FCNTL_WIN32_AV_RETRY]] ** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic ** retry counts and intervals for certain disk I/O operations for the ** windows [VFS] in order to provide robustness in the presence of ** anti-virus programs. By default, the windows VFS will retry file read, ** file write, and file delete operations up to 10 times, with a delay @@ -768,13 +761,12 @@ ** integer is the delay. If either integer is negative, then the setting ** is not changed but instead the prior value of that setting is written ** into the array entry, allowing the current retry settings to be ** interrogated. The zDbName parameter is ignored. ** -**
    • [[SQLITE_FCNTL_PERSIST_WAL]] ** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the -** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** persistent [WAL | Write AHead Log] setting. By default, the auxiliary ** write ahead log and shared memory files used for transaction control ** are automatically deleted when the latest connection to the database ** closes. Setting persistent WAL mode causes those files to persist after ** close. Persisting the files is useful when other processes that do not ** have write permission on the directory containing the database file want @@ -783,27 +775,24 @@ ** [sqlite3_file_control()] for this opcode should be a pointer to an integer. ** That integer is 0 to disable persistent WAL mode or 1 to enable persistent ** WAL mode. If the integer is -1, then it is overwritten with the current ** WAL persistence setting. ** -**
    • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] ** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the ** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting ** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the ** xDeviceCharacteristics methods. The fourth parameter to ** [sqlite3_file_control()] for this opcode should be a pointer to an integer. ** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage ** mode. If the integer is -1, then it is overwritten with the current ** zero-damage mode setting. ** -**
    • [[SQLITE_FCNTL_OVERWRITE]] ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening ** a write transaction to indicate that, unless it is rolled back for some ** reason, the entire database file will be overwritten by the current ** transaction. This is used by VACUUM operations. ** -**
    • [[SQLITE_FCNTL_VFSNAME]] ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of ** all [VFSes] in the VFS stack. The names are of all VFS shims and the ** final bottom-level VFS are written into memory obtained from ** [sqlite3_malloc()] and the result is stored in the char* variable ** that the fourth parameter of [sqlite3_file_control()] points to. @@ -810,34 +799,10 @@ ** The caller is responsible for freeing the memory when done. As with ** all file-control actions, there is no guarantee that this will actually ** do anything. Callers should initialize the char* variable to a NULL ** pointer in case this file-control is not implemented. This file-control ** is intended for diagnostic use only. -** -**
    • [[SQLITE_FCNTL_PRAGMA]] -** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] -** file control is sent to the open [sqlite3_file] object corresponding -** to the database file to which the pragma statement refers. ^The argument -** to the [SQLITE_FCNTL_PRAGMA] file control is an array of -** pointers to strings (char**) in which the second element of the array -** is the name of the pragma and the third element is the argument to the -** pragma or NULL if the pragma has no argument. ^The handler for an -** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element -** of the char** argument point to a string obtained from [sqlite3_mprintf()] -** or the equivalent and that string will become the result of the pragma or -** the error message if the pragma fails. ^If the -** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal -** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] -** file control returns [SQLITE_OK], then the parser assumes that the -** VFS has handled the PRAGMA itself and the parser generates a no-op -** prepared statement. ^If the [SQLITE_FCNTL_PRAGMA] file control returns -** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means -** that the VFS encountered an error while handling the [PRAGMA] and the -** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] -** file control occurs at the beginning of pragma statement analysis and so -** it is able to override built-in [PRAGMA] statements. -**
    */ #define SQLITE_FCNTL_LOCKSTATE 1 #define SQLITE_GET_LOCKPROXYFILE 2 #define SQLITE_SET_LOCKPROXYFILE 3 #define SQLITE_LAST_ERRNO 4 @@ -848,11 +813,10 @@ #define SQLITE_FCNTL_WIN32_AV_RETRY 9 #define SQLITE_FCNTL_PERSIST_WAL 10 #define SQLITE_FCNTL_OVERWRITE 11 #define SQLITE_FCNTL_VFSNAME 12 #define SQLITE_FCNTL_POWERSAFE_OVERWRITE 13 -#define SQLITE_FCNTL_PRAGMA 14 /* ** CAPI3REF: Mutex Handle ** ** The mutex module within SQLite defines [sqlite3_mutex] to be an @@ -1546,11 +1510,11 @@ ** database connection is opened. By default, URI handling is globally ** disabled. The default value may be changed by compiling with the ** [SQLITE_USE_URI] symbol defined. ** ** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]] -**
    SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE +**
    SQLITE_CONFIG_PCACHE and SQLITE_CONFNIG_GETPCACHE **
    These options are obsolete and should not be used by new code. ** They are retained for backwards compatibility but are now no-ops. ** */ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ @@ -2678,18 +2642,13 @@ ** has no explicit value, then sqlite3_uri_parameter(F,P) returns ** a pointer to an empty string. ** ** The sqlite3_uri_boolean(F,P,B) routine assumes that P is a boolean ** parameter and returns true (1) or false (0) according to the value -** of P. The sqlite3_uri_boolean(F,P,B) routine returns true (1) if the -** value of query parameter P is one of "yes", "true", or "on" in any -** case or if the value begins with a non-zero number. The -** sqlite3_uri_boolean(F,P,B) routines returns false (0) if the value of -** query parameter P is one of "no", "false", or "off" in any case or -** if the value begins with a numeric zero. If P is not a query -** parameter on F or if the value of P is does not match any of the -** above, then sqlite3_uri_boolean(F,P,B) returns (B!=0). +** of P. The value of P is true if it is "yes" or "true" or "on" or +** a non-zero number and is false otherwise. If P is not a query parameter +** on F then sqlite3_uri_boolean(F,P,B) returns (B!=0). ** ** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a ** 64-bit signed integer and returns that integer, or D if P does not ** exist. If the value of P is something other than an integer, then ** zero is returned. @@ -4498,19 +4457,10 @@ ** will be an absolute pathname, even if the filename used ** to open the database originally was a URI or relative pathname. */ SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); -/* -** CAPI3REF: Determine if a database is read-only -** -** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N -** of connection D is read-only, 0 if it is read/write, or -1 if N is not -** the name of a database on connection D. -*/ -SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName); - /* ** CAPI3REF: Find the next prepared statement ** ** ^This interface returns a pointer to the next [prepared statement] after ** pStmt associated with the [database connection] pDb. ^If pStmt is NULL @@ -6005,21 +5955,10 @@ ** [[SQLITE_DBSTATUS_CACHE_MISS]] ^(
    SQLITE_DBSTATUS_CACHE_MISS
    **
    This parameter returns the number of pager cache misses that have ** occurred.)^ ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS ** is always 0. **
    -** -** [[SQLITE_DBSTATUS_CACHE_WRITE]] ^(
    SQLITE_DBSTATUS_CACHE_WRITE
    -**
    This parameter returns the number of dirty cache entries that have -** been written to disk. Specifically, the number of pages written to the -** wal file in wal mode databases, or the number of pages written to the -** database file in rollback mode databases. Any pages written as part of -** transaction rollback or database recovery operations are not included. -** If an IO or other error occurs while writing a page to disk, the effect -** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The -** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0. -**
    ** */ #define SQLITE_DBSTATUS_LOOKASIDE_USED 0 #define SQLITE_DBSTATUS_CACHE_USED 1 #define SQLITE_DBSTATUS_SCHEMA_USED 2 @@ -6027,12 +5966,11 @@ #define SQLITE_DBSTATUS_LOOKASIDE_HIT 4 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6 #define SQLITE_DBSTATUS_CACHE_HIT 7 #define SQLITE_DBSTATUS_CACHE_MISS 8 -#define SQLITE_DBSTATUS_CACHE_WRITE 9 -#define SQLITE_DBSTATUS_MAX 9 /* Largest defined DBSTATUS */ +#define SQLITE_DBSTATUS_MAX 8 /* Largest defined DBSTATUS */ /* ** CAPI3REF: Prepared Statement Status ** @@ -6644,16 +6582,15 @@ /* ** CAPI3REF: String Comparison ** -** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications -** and extensions to compare the contents of two buffers containing UTF-8 -** strings in a case-independent fashion, using the same definition of "case -** independence" that SQLite uses internally when comparing identifiers. +** ^The [sqlite3_strnicmp()] API allows applications and extensions to +** compare the contents of two buffers containing UTF-8 strings in a +** case-independent fashion, using the same definition of case independence +** that SQLite uses internally when comparing identifiers. */ -SQLITE_API int sqlite3_stricmp(const char *, const char *); SQLITE_API int sqlite3_strnicmp(const char *, const char *, int); /* ** CAPI3REF: Error Logging Interface ** @@ -6984,15 +6921,11 @@ ** SELECT ... FROM WHERE MATCH $zGeom(... params ...) */ SQLITE_API int sqlite3_rtree_geometry_callback( sqlite3 *db, const char *zGeom, -#ifdef SQLITE_RTREE_INT_ONLY - int (*xGeom)(sqlite3_rtree_geometry*, int n, sqlite3_int64 *a, int *pRes), -#else - int (*xGeom)(sqlite3_rtree_geometry*, int n, double *a, int *pRes), -#endif + int (*xGeom)(sqlite3_rtree_geometry *, int nCoord, double *aCoord, int *pRes), void *pContext ); /* Index: SQLite.Interop/src/win/crypt.c ================================================================== --- SQLite.Interop/src/win/crypt.c +++ SQLite.Interop/src/win/crypt.c @@ -375,11 +375,11 @@ } // If we failed, rollback if (rc) { - sqlite3BtreeRollback(pbt, SQLITE_OK); + sqlite3BtreeRollback(pbt); } // If we succeeded, destroy any previous read key this database used // and make the readkey equal to the writekey if (!rc) Index: SQLite.Interop/src/win/interop.c ================================================================== --- SQLite.Interop/src/win/interop.c +++ SQLite.Interop/src/win/interop.c @@ -1,16 +1,11 @@ #define SQLITE_API __declspec(dllexport) #include "../core/sqlite3.c" - -#if defined(INTEROP_EXTENSION_FUNCTIONS) #include "../contrib/extension-functions.c" -extern int RegisterExtensionFunctions(sqlite3 *db); -#endif - -#if defined(INTEROP_CODEC) #include "crypt.c" -#endif + +extern int RegisterExtensionFunctions(sqlite3 *db); #ifdef SQLITE_OS_WIN // Additional open flags, we use this one privately //#define SQLITE_OPEN_SHAREDCACHE 0x01000000 @@ -116,14 +111,12 @@ //sqlite3_enable_shared_cache(sharedcache); ret = sqlite3_open_v2(filename, ppdb, flags, NULL); //sqlite3_enable_shared_cache(0); -#if defined(INTEROP_EXTENSION_FUNCTIONS) if (ret == 0) RegisterExtensionFunctions(*ppdb); -#endif return ret; } SQLITE_API int WINAPI sqlite3_open16_interop(const char *filename, int flags, sqlite3 **ppdb) Index: SQLite.Interop/src/win/interop.h ================================================================== --- SQLite.Interop/src/win/interop.h +++ SQLite.Interop/src/win/interop.h @@ -6,7 +6,7 @@ * Released to the public domain, use at your own risk! * */ #ifndef INTEROP_VERSION -#define INTEROP_VERSION "1.0.81.0" +#define INTEROP_VERSION "1.0.78.0" #endif Index: SQLite.MSIL.nuspec ================================================================== --- SQLite.MSIL.nuspec +++ SQLite.MSIL.nuspec @@ -1,10 +1,10 @@ System.Data.SQLite.MSIL - 1.0.81.0 + 1.0.78.0 SQLite Development Team An ADO.NET provider for SQLite (managed-only). en-US http://system.data.sqlite.org/ http://system.data.sqlite.org/images/sqlite32.png DELETED SQLite.NET.2005.MSBuild.sln Index: SQLite.NET.2005.MSBuild.sln ================================================================== --- SQLite.NET.2005.MSBuild.sln +++ /dev/null @@ -1,548 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{39A3B743-1EBD-4CC0-8E37-ACE3DD38B1C0}" - ProjectSection(SolutionItems) = preProject - readme.htm = readme.htm - SQLite.NET.Settings.targets = SQLite.NET.Settings.targets - System.Data.SQLite\System.Data.SQLite.Files.targets = System.Data.SQLite\System.Data.SQLite.Files.targets - System.Data.SQLite\System.Data.SQLite.Properties.targets = System.Data.SQLite\System.Data.SQLite.Properties.targets - System.Data.SQLite\System.Data.SQLite.References.targets = System.Data.SQLite\System.Data.SQLite.References.targets - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SQLite.2005", "System.Data.SQLite\System.Data.SQLite.2005.csproj", "{AC139952-261A-4463-B6FA-AEBC25283A66}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SQLite.Module.2005", "System.Data.SQLite\System.Data.SQLite.Module.2005.csproj", "{AC139952-261A-4463-B6FA-AEBC25284A66}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test.2005", "test\test.2005.csproj", "{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite.Interop.2005", "SQLite.Interop\SQLite.Interop.2005.vcproj", "{53784BC1-A8BC-4AC8-8A3E-158D6807345A}" - ProjectSection(ProjectDependencies) = postProject - {AC139952-261A-4463-B6FA-AEBC25284A66} = {AC139952-261A-4463-B6FA-AEBC25284A66} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite.Designer.2005", "SQLite.Designer\SQLite.Designer.2005.csproj", "{9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SQLite.Compact.2005", "System.Data.SQLite\System.Data.SQLite.Compact.2005.csproj", "{AC139951-261A-4463-B6FA-AEBC25283A66}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite.Interop.CE.2005", "SQLite.Interop\SQLite.Interop.CE.2005.vcproj", "{9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testce.2005", "testce\testce.2005.csproj", "{B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite.Interop.Static.2005", "SQLite.Interop\SQLite.Interop.Static.2005.vcproj", "{490CBC51-A3B2-4397-89F9-16E858DCB4F8}" - ProjectSection(ProjectDependencies) = postProject - {AC139952-261A-4463-B6FA-AEBC25284A66} = {AC139952-261A-4463-B6FA-AEBC25284A66} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Installer.2005", "tools\install\Installer.2005.csproj", "{A41FE2A5-07AD-4CE7-B836-1544634816F5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Pocket PC 2003 (ARMV4) = Debug|Pocket PC 2003 (ARMV4) - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - DebugManagedOnly|Any CPU = DebugManagedOnly|Any CPU - DebugManagedOnly|Mixed Platforms = DebugManagedOnly|Mixed Platforms - DebugManagedOnly|Pocket PC 2003 (ARMV4) = DebugManagedOnly|Pocket PC 2003 (ARMV4) - DebugManagedOnly|Win32 = DebugManagedOnly|Win32 - DebugManagedOnly|x64 = DebugManagedOnly|x64 - DebugNativeOnly|Any CPU = DebugNativeOnly|Any CPU - DebugNativeOnly|Mixed Platforms = DebugNativeOnly|Mixed Platforms - DebugNativeOnly|Pocket PC 2003 (ARMV4) = DebugNativeOnly|Pocket PC 2003 (ARMV4) - DebugNativeOnly|Win32 = DebugNativeOnly|Win32 - DebugNativeOnly|x64 = DebugNativeOnly|x64 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Pocket PC 2003 (ARMV4) = Release|Pocket PC 2003 (ARMV4) - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - ReleaseManagedOnly|Any CPU = ReleaseManagedOnly|Any CPU - ReleaseManagedOnly|Mixed Platforms = ReleaseManagedOnly|Mixed Platforms - ReleaseManagedOnly|Pocket PC 2003 (ARMV4) = ReleaseManagedOnly|Pocket PC 2003 (ARMV4) - ReleaseManagedOnly|Win32 = ReleaseManagedOnly|Win32 - ReleaseManagedOnly|x64 = ReleaseManagedOnly|x64 - ReleaseNativeOnly|Any CPU = ReleaseNativeOnly|Any CPU - ReleaseNativeOnly|Mixed Platforms = ReleaseNativeOnly|Mixed Platforms - ReleaseNativeOnly|Pocket PC 2003 (ARMV4) = ReleaseNativeOnly|Pocket PC 2003 (ARMV4) - ReleaseNativeOnly|Win32 = ReleaseNativeOnly|Win32 - ReleaseNativeOnly|x64 = ReleaseNativeOnly|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Win32.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|x64.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Any CPU.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Win32.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|x64.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Any CPU.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Win32.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|x64.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|x64.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Any CPU.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Mixed Platforms.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Win32.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|x64.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|x64.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Win32.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|x64.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugManagedOnly|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugManagedOnly|Any CPU.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugManagedOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugManagedOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugManagedOnly|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugManagedOnly|Win32.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugManagedOnly|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugManagedOnly|x64.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Any CPU.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Win32.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|x64.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|x64.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseManagedOnly|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseManagedOnly|Any CPU.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseManagedOnly|Mixed Platforms.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseManagedOnly|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseManagedOnly|Win32.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseManagedOnly|x64.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseManagedOnly|x64.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Win32.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Win32.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|x64.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|x64.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugManagedOnly|Any CPU.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugManagedOnly|Any CPU.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugManagedOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugManagedOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugManagedOnly|Win32.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugManagedOnly|Win32.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugManagedOnly|x64.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugManagedOnly|x64.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Any CPU.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Win32.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Win32.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|x64.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|x64.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseManagedOnly|Any CPU.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseManagedOnly|Any CPU.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseManagedOnly|Mixed Platforms.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseManagedOnly|Win32.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseManagedOnly|Win32.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseManagedOnly|x64.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseManagedOnly|x64.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Any CPU.Build.0 = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Win32.ActiveCfg = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Win32.Build.0 = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|x64.ActiveCfg = Debug|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|x64.Build.0 = Debug|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugManagedOnly|Any CPU.ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugManagedOnly|Mixed Platforms.ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugManagedOnly|Win32.ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugManagedOnly|x64.ActiveCfg = DebugNativeOnly|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Any CPU.ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Any CPU.Build.0 = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Mixed Platforms.ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Mixed Platforms.Build.0 = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Win32.ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Win32.Build.0 = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|x64.ActiveCfg = DebugNativeOnly|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|x64.Build.0 = DebugNativeOnly|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Any CPU.ActiveCfg = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Any CPU.Build.0 = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Mixed Platforms.Build.0 = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Win32.ActiveCfg = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Win32.Build.0 = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|x64.ActiveCfg = Release|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|x64.Build.0 = Release|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseManagedOnly|Any CPU.ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseManagedOnly|Win32.ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseManagedOnly|x64.ActiveCfg = ReleaseNativeOnly|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Any CPU.ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Any CPU.Build.0 = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Mixed Platforms.Build.0 = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Win32.ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Win32.Build.0 = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|x64.ActiveCfg = ReleaseNativeOnly|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|x64.Build.0 = ReleaseNativeOnly|x64 - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Win32.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Win32.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|x64.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|x64.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugManagedOnly|Any CPU.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugManagedOnly|Any CPU.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugManagedOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugManagedOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugManagedOnly|Win32.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugManagedOnly|Win32.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugManagedOnly|x64.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugManagedOnly|x64.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Any CPU.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Win32.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Win32.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|x64.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|x64.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseManagedOnly|Any CPU.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseManagedOnly|Any CPU.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseManagedOnly|Mixed Platforms.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseManagedOnly|Win32.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseManagedOnly|Win32.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseManagedOnly|x64.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseManagedOnly|x64.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Win32.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Any CPU.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Any CPU.Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Pocket PC 2003 (ARMV4).Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|Win32.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugManagedOnly|x64.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Any CPU.Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Win32.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|x64.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Any CPU.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Any CPU.Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Mixed Platforms.Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|Win32.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseManagedOnly|x64.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Any CPU.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Any CPU.Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Any CPU.Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Mixed Platforms.Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Mixed Platforms.Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Win32.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|x64.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugManagedOnly|Any CPU.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugManagedOnly|Mixed Platforms.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugManagedOnly|Win32.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugManagedOnly|x64.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Any CPU.Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Any CPU.Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Mixed Platforms.Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Win32.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|x64.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Any CPU.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Any CPU.Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Any CPU.Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Mixed Platforms.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Mixed Platforms.Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Mixed Platforms.Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Win32.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|x64.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseManagedOnly|Any CPU.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseManagedOnly|Win32.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseManagedOnly|x64.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Any CPU.Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Mixed Platforms.Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|x64.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Mixed Platforms.Deploy.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Win32.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|x64.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Any CPU.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Any CPU.Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Any CPU.Deploy.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Mixed Platforms.Deploy.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Pocket PC 2003 (ARMV4).Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|Win32.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugManagedOnly|x64.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Any CPU.Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Any CPU.Deploy.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Mixed Platforms.Deploy.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Win32.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|x64.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Any CPU.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Any CPU.Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Any CPU.Deploy.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Mixed Platforms.Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Mixed Platforms.Deploy.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|Win32.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseManagedOnly|x64.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Any CPU.Build.0 = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Win32.ActiveCfg = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Win32.Build.0 = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|x64.ActiveCfg = Debug|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|x64.Build.0 = Debug|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugManagedOnly|Any CPU.ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugManagedOnly|Mixed Platforms.ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugManagedOnly|Win32.ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugManagedOnly|x64.ActiveCfg = DebugNativeOnly|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Any CPU.ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Any CPU.Build.0 = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Mixed Platforms.ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Mixed Platforms.Build.0 = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Win32.ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Win32.Build.0 = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|x64.ActiveCfg = DebugNativeOnly|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|x64.Build.0 = DebugNativeOnly|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Any CPU.ActiveCfg = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Any CPU.Build.0 = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Mixed Platforms.Build.0 = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Win32.ActiveCfg = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Win32.Build.0 = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|x64.ActiveCfg = Release|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|x64.Build.0 = Release|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseManagedOnly|Any CPU.ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseManagedOnly|Win32.ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseManagedOnly|x64.ActiveCfg = ReleaseNativeOnly|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Any CPU.ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Any CPU.Build.0 = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Mixed Platforms.Build.0 = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Win32.ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Win32.Build.0 = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|x64.ActiveCfg = ReleaseNativeOnly|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|x64.Build.0 = ReleaseNativeOnly|x64 - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugManagedOnly|Any CPU.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugManagedOnly|Any CPU.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugManagedOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugManagedOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugManagedOnly|Win32.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugManagedOnly|Win32.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugManagedOnly|x64.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugManagedOnly|x64.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseManagedOnly|Any CPU.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseManagedOnly|Any CPU.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseManagedOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseManagedOnly|Mixed Platforms.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseManagedOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseManagedOnly|Win32.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseManagedOnly|Win32.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseManagedOnly|x64.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseManagedOnly|x64.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal DELETED SQLite.NET.2005.sln Index: SQLite.NET.2005.sln ================================================================== --- SQLite.NET.2005.sln +++ /dev/null @@ -1,425 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{39A3B743-1EBD-4CC0-8E37-ACE3DD38B1C0}" - ProjectSection(SolutionItems) = preProject - readme.htm = readme.htm - SQLite.NET.Settings.targets = SQLite.NET.Settings.targets - System.Data.SQLite\System.Data.SQLite.Files.targets = System.Data.SQLite\System.Data.SQLite.Files.targets - System.Data.SQLite\System.Data.SQLite.Properties.targets = System.Data.SQLite\System.Data.SQLite.Properties.targets - System.Data.SQLite\System.Data.SQLite.References.targets = System.Data.SQLite\System.Data.SQLite.References.targets - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SQLite.2005", "System.Data.SQLite\System.Data.SQLite.2005.csproj", "{AC139952-261A-4463-B6FA-AEBC25283A66}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SQLite.Module.2005", "System.Data.SQLite\System.Data.SQLite.Module.2005.csproj", "{AC139952-261A-4463-B6FA-AEBC25284A66}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.SQLite.Compact.2005", "System.Data.SQLite\System.Data.SQLite.Compact.2005.csproj", "{AC139951-261A-4463-B6FA-AEBC25283A66}" - ProjectSection(ProjectDependencies) = postProject - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6} = {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "test.2005", "test\test.2005.csproj", "{E27B1B1E-19C0-45E8-AA74-B6E1C041A130}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite.Interop.2005", "SQLite.Interop\SQLite.Interop.2005.vcproj", "{53784BC1-A8BC-4AC8-8A3E-158D6807345A}" - ProjectSection(ProjectDependencies) = postProject - {AC139952-261A-4463-B6FA-AEBC25284A66} = {AC139952-261A-4463-B6FA-AEBC25284A66} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLite.Designer.2005", "SQLite.Designer\SQLite.Designer.2005.csproj", "{9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "testce.2005", "testce\testce.2005.csproj", "{B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite.Interop.CE.2005", "SQLite.Interop\SQLite.Interop.CE.2005.vcproj", "{9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SQLite.Interop.Static.2005", "SQLite.Interop\SQLite.Interop.Static.2005.vcproj", "{490CBC51-A3B2-4397-89F9-16E858DCB4F8}" - ProjectSection(ProjectDependencies) = postProject - {AC139952-261A-4463-B6FA-AEBC25284A66} = {AC139952-261A-4463-B6FA-AEBC25284A66} - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Installer.2005", "tools\install\Installer.2005.csproj", "{A41FE2A5-07AD-4CE7-B836-1544634816F5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Pocket PC 2003 (ARMV4) = Debug|Pocket PC 2003 (ARMV4) - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - DebugNativeOnly|Any CPU = DebugNativeOnly|Any CPU - DebugNativeOnly|Mixed Platforms = DebugNativeOnly|Mixed Platforms - DebugNativeOnly|Pocket PC 2003 (ARMV4) = DebugNativeOnly|Pocket PC 2003 (ARMV4) - DebugNativeOnly|Win32 = DebugNativeOnly|Win32 - DebugNativeOnly|x64 = DebugNativeOnly|x64 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Pocket PC 2003 (ARMV4) = Release|Pocket PC 2003 (ARMV4) - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - ReleaseNativeOnly|Any CPU = ReleaseNativeOnly|Any CPU - ReleaseNativeOnly|Mixed Platforms = ReleaseNativeOnly|Mixed Platforms - ReleaseNativeOnly|Pocket PC 2003 (ARMV4) = ReleaseNativeOnly|Pocket PC 2003 (ARMV4) - ReleaseNativeOnly|Win32 = ReleaseNativeOnly|Win32 - ReleaseNativeOnly|x64 = ReleaseNativeOnly|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|Win32.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Debug|x64.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Win32.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|x64.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Any CPU.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|Win32.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|x64.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.Release|x64.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Win32.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|x64.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|Win32.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Debug|x64.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|Win32.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.DebugNativeOnly|x64.Build.0 = Debug|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Any CPU.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|Win32.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|x64.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.Release|x64.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|Win32.Build.0 = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {AC139952-261A-4463-B6FA-AEBC25284A66}.ReleaseNativeOnly|x64.Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|Win32.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Debug|x64.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Pocket PC 2003 (ARMV4).Build.0 = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Any CPU.Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|Win32.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.Release|x64.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).Build.0 = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {AC139951-261A-4463-B6FA-AEBC25283A66}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Win32.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|Win32.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|x64.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Debug|x64.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|Win32.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.DebugNativeOnly|x64.Build.0 = Debug|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Any CPU.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Win32.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|Win32.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|x64.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.Release|x64.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|Win32.Build.0 = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130}.ReleaseNativeOnly|x64.Build.0 = Release|Any CPU - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Any CPU.Build.0 = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Win32.ActiveCfg = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|Win32.Build.0 = Debug|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|x64.ActiveCfg = Debug|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Debug|x64.Build.0 = Debug|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Any CPU.ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Any CPU.Build.0 = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Mixed Platforms.ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Mixed Platforms.Build.0 = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Win32.ActiveCfg = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|Win32.Build.0 = DebugNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|x64.ActiveCfg = DebugNativeOnly|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.DebugNativeOnly|x64.Build.0 = DebugNativeOnly|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Any CPU.ActiveCfg = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Any CPU.Build.0 = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Mixed Platforms.Build.0 = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Win32.ActiveCfg = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|Win32.Build.0 = Release|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|x64.ActiveCfg = Release|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.Release|x64.Build.0 = Release|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Any CPU.ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Any CPU.Build.0 = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Mixed Platforms.Build.0 = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Win32.ActiveCfg = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|Win32.Build.0 = ReleaseNativeOnly|Win32 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|x64.ActiveCfg = ReleaseNativeOnly|x64 - {53784BC1-A8BC-4AC8-8A3E-158D6807345A}.ReleaseNativeOnly|x64.Build.0 = ReleaseNativeOnly|x64 - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Win32.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|Win32.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|x64.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Debug|x64.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|Win32.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.DebugNativeOnly|x64.Build.0 = Debug|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Any CPU.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Win32.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|Win32.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|x64.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.Release|x64.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|Win32.Build.0 = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {9B4A5CF6-5BE5-4926-ACC7-B729A8C05198}.ReleaseNativeOnly|x64.Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|Win32.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Debug|x64.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Pocket PC 2003 (ARMV4).Build.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Any CPU.Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|Win32.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.Release|x64.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).Build.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Any CPU.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Any CPU.Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Mixed Platforms.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Mixed Platforms.Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|Win32.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Debug|x64.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Any CPU.Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|Win32.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.DebugNativeOnly|x64.ActiveCfg = Debug|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Any CPU.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Any CPU.Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Mixed Platforms.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Mixed Platforms.Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|Win32.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.Release|x64.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {9E5A8F20-5F04-4629-B2E1-27B5E30F2AF6}.ReleaseNativeOnly|x64.ActiveCfg = Release|Pocket PC 2003 (ARMV4) - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Any CPU.Build.0 = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Win32.ActiveCfg = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|Win32.Build.0 = Debug|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|x64.ActiveCfg = Debug|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Debug|x64.Build.0 = Debug|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Any CPU.ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Any CPU.Build.0 = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Mixed Platforms.ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Mixed Platforms.Build.0 = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Win32.ActiveCfg = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|Win32.Build.0 = DebugNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|x64.ActiveCfg = DebugNativeOnly|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.DebugNativeOnly|x64.Build.0 = DebugNativeOnly|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Any CPU.ActiveCfg = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Any CPU.Build.0 = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Mixed Platforms.Build.0 = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Win32.ActiveCfg = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|Win32.Build.0 = Release|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|x64.ActiveCfg = Release|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.Release|x64.Build.0 = Release|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Any CPU.ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Any CPU.Build.0 = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Mixed Platforms.Build.0 = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Win32.ActiveCfg = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|Win32.Build.0 = ReleaseNativeOnly|Win32 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|x64.ActiveCfg = ReleaseNativeOnly|x64 - {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|x64.Build.0 = ReleaseNativeOnly|x64 - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Win32.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|x64.Build.0 = Debug|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Win32.Build.0 = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU - {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|x64.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal Index: SQLite.NET.2010.sln ================================================================== --- SQLite.NET.2010.sln +++ SQLite.NET.2010.sln @@ -315,34 +315,38 @@ {490CBC51-A3B2-4397-89F9-16E858DCB4F8}.ReleaseNativeOnly|x64.Build.0 = ReleaseNativeOnly|x64 {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Any CPU.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|Win32.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Debug|x64.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Any CPU.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Any CPU.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Mixed Platforms.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Mixed Platforms.Build.0 = Debug|Any CPU + {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Win32.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|Win32.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|x64.ActiveCfg = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.DebugNativeOnly|x64.Build.0 = Debug|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Any CPU.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|Win32.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.Release|x64.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Any CPU.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Any CPU.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Mixed Platforms.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Mixed Platforms.Build.0 = Release|Any CPU + {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Win32.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|Win32.Build.0 = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|x64.ActiveCfg = Release|Any CPU {A41FE2A5-07AD-4CE7-B836-1544634816F5}.ReleaseNativeOnly|x64.Build.0 = Release|Any CPU EndGlobalSection Index: SQLite.NET.Settings.targets ================================================================== --- SQLite.NET.Settings.targets +++ SQLite.NET.Settings.targets @@ -112,54 +112,10 @@ default, this is enabled. If this is disabled, an exception will not be thrown when a SQLite object which has already been disposed is accessed. --> true - - - true - - - true - - - true - - - - - - - - - - - - - - - - Index: SQLite.nuspec ================================================================== --- SQLite.nuspec +++ SQLite.nuspec @@ -1,11 +1,11 @@ System.Data.SQLite System.Data.SQLite (x86) - 1.0.81.0 + 1.0.78.0 SQLite Development Team The official SQLite database engine combined with a complete ADO.NET provider all rolled into a single mixed-mode assembly for x86. en-US http://system.data.sqlite.org/ http://system.data.sqlite.org/images/sqlite32.png Index: SQLite.x64.nuspec ================================================================== --- SQLite.x64.nuspec +++ SQLite.x64.nuspec @@ -1,10 +1,10 @@ System.Data.SQLite.x64 - 1.0.81.0 + 1.0.78.0 SQLite Development Team The official SQLite database engine combined with a complete ADO.NET provider all rolled into a single mixed-mode assembly for x64. en-US http://system.data.sqlite.org/ http://system.data.sqlite.org/images/sqlite32.png Index: SQLite.x86.nuspec ================================================================== --- SQLite.x86.nuspec +++ SQLite.x86.nuspec @@ -1,10 +1,10 @@ System.Data.SQLite.x86 - 1.0.81.0 + 1.0.78.0 SQLite Development Team The official SQLite database engine combined with a complete ADO.NET provider all rolled into a single mixed-mode assembly for x86. en-US http://system.data.sqlite.org/ http://system.data.sqlite.org/images/sqlite32.png Index: Setup/SQLite.iss ================================================================== --- Setup/SQLite.iss +++ Setup/SQLite.iss @@ -15,11 +15,11 @@ #else #define InstallerCondition "Application\Core\MSIL and Application\Core\" + AppProcessor + " and Application\Designer and Application\Designer\Installer" #define AppVersion GetStringFileInfo("..\bin\" + Year + "\" + BaseConfiguration + "\bin\System.Data.SQLite.dll", PRODUCT_VERSION) #define OutputConfiguration StringChange(StringChange(BaseConfiguration, "Debug", "setup"), "Release", "setup") #endif - + [Setup] AllowNoIcons=true #if AppProcessor != "x86" ArchitecturesAllowed={#AppProcessor} @@ -54,50 +54,38 @@ [Components] Name: Application; Description: System.Data.SQLite components.; Types: custom compact full Name: Application\Core; Description: Core components.; Types: custom compact full Name: Application\Core\MSIL; Description: Core managed components.; Types: custom compact full -Name: Application\Core\{#AppProcessor}; Description: Core native {#AppProcessor} components.; Types: custom compact full +Name: Application\Core\{#AppProcessor}; Description: Core native components.; Types: custom compact full Name: Application\LINQ; Description: LINQ support components.; Types: custom compact full Name: Application\Designer; Description: Visual Studio designer components.; Types: custom full Name: Application\Designer\Installer; Description: Visual Studio designer installer components.; Types: custom full Name: Application\Symbols; Description: Debugging symbol components.; Types: custom compact full Name: Application\Documentation; Description: Documentation components.; Types: custom compact full Name: Application\Test; Description: Test components.; Types: custom compact full [Tasks] Components: Application\Core\MSIL Or Application\LINQ; Name: ngen; Description: Generate native images for the assemblies and install the images in the native image cache.; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup() +Components: {#InstallerCondition}; Name: vs2008; Description: Install the designer components for Visual Studio 2008.; Check: CheckIsNetFx2Setup() +Components: {#InstallerCondition}; Name: vs2010; Description: Install the designer components for Visual Studio 2010.; Check: CheckIsNetFx4Setup() #if Pos("NativeOnly", AppConfiguration) == 0 Components: Application\Core\MSIL Or Application\LINQ; Name: gac; Description: Install the assemblies into the global assembly cache.; Flags: unchecked; Check: CheckIsNetFx2Setup() or CheckIsNetFx4Setup() - -#if AppProcessor == "x86" -Components: {#InstallerCondition}; Name: gac\vs2005; Description: Install the designer components for Visual Studio 2005.; Flags: unchecked; Check: CheckIsNetFx2Setup() -Components: {#InstallerCondition}; Name: gac\vs2008; Description: Install the designer components for Visual Studio 2008.; Flags: unchecked; Check: CheckIsNetFx2Setup() -Components: {#InstallerCondition}; Name: gac\vs2010; Description: Install the designer components for Visual Studio 2010.; Flags: unchecked; Check: CheckIsNetFx4Setup() -#endif #endif [Run] Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() and CheckForNetFx35(1) Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "install ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() - -#if Pos("NativeOnly", AppConfiguration) == 0 && AppProcessor == "x86" -Components: {#InstallerCondition}; Tasks: gac\vs2005; Filename: {app}\bin\Installer.exe; Parameters: "-install true -wow64 true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx40 true -noVs2008 true -noVs2010 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() -Components: {#InstallerCondition}; Tasks: gac\vs2008; Filename: {app}\bin\Installer.exe; Parameters: "-install true -wow64 true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx40 true -noVs2005 true -noVs2010 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() -Components: {#InstallerCondition}; Tasks: gac\vs2010; Filename: {app}\bin\Installer.exe; Parameters: "-install true -wow64 true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx20 true -noVs2005 true -noVs2008 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() -#endif +Components: {#InstallerCondition}; Tasks: vs2008; Filename: {app}\bin\Installer.exe; Parameters: "-install true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx40 true -noVs2010 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() +Components: {#InstallerCondition}; Tasks: vs2010; Filename: {app}\bin\Installer.exe; Parameters: "-install true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx20 true -noVs2008 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() [UninstallRun] -#if Pos("NativeOnly", AppConfiguration) == 0 && AppProcessor == "x86" -Components: {#InstallerCondition}; Tasks: gac\vs2010; Filename: {app}\bin\Installer.exe; Parameters: "-install false -wow64 true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx20 true -noVs2005 true -noVs2008 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() -Components: {#InstallerCondition}; Tasks: gac\vs2008; Filename: {app}\bin\Installer.exe; Parameters: "-install false -wow64 true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx40 true -noVs2005 true -noVs2010 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() -Components: {#InstallerCondition}; Tasks: gac\vs2005; Filename: {app}\bin\Installer.exe; Parameters: "-install false -wow64 true -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx40 true -noVs2008 true -noVs2010 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() -#endif - +Components: {#InstallerCondition}; Tasks: vs2010; Filename: {app}\bin\Installer.exe; Parameters: "-install false -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx20 true -noVs2008 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() +Components: {#InstallerCondition}; Tasks: vs2008; Filename: {app}\bin\Installer.exe; Parameters: "-install false -installFlags AllExceptGAC -tracePriority Lowest -verbose true -noCompact true -noNetFx40 true -noVs2010 true -whatIf false -confirm true"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() Components: Application\LINQ; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.Linq.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() and CheckForNetFx35(1) Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx4InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx4Setup() Components: Application\Core\MSIL; Tasks: ngen; Filename: {code:GetNetFx2InstallRoot|Ngen.exe}; Parameters: "uninstall ""{app}\bin\System.Data.SQLite.dll"" /nologo"; Flags: skipifdoesntexist; Check: CheckIsNetFx2Setup() Index: Setup/archive.bat ================================================================== --- Setup/archive.bat +++ Setup/archive.bat @@ -9,12 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO2=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -28,11 +27,11 @@ %_VECHO% Root = '%ROOT%' %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel -%__ECHO2% PUSHD "%ROOT%" +%_ECHO% PUSHD "%ROOT%" IF ERRORLEVEL 1 ( ECHO Could not change directory to "%ROOT%". GOTO errors ) @@ -66,26 +65,26 @@ %_VECHO% Version = '%VERSION%' CALL :fn_ResetErrorLevel IF NOT EXIST Setup\Output ( - %__ECHO% MKDIR Setup\Output + %_ECHO% MKDIR Setup\Output IF ERRORLEVEL 1 ( ECHO Could not create directory "Setup\Output". GOTO errors ) ) -%__ECHO% zip.exe -v -r Setup\Output\sqlite-netFx-source-%VERSION%.zip * -x @exclude_src.txt +%_ECHO% zip.exe -v -r Setup\Output\sqlite-netFx-source-%VERSION%.zip * -x @exclude_src.txt IF ERRORLEVEL 1 ( ECHO Failed to archive source files. GOTO errors ) -%__ECHO2% POPD +%_ECHO% POPD IF ERRORLEVEL 1 ( ECHO Could not restore directory. GOTO errors ) @@ -119,6 +118,6 @@ ECHO. ECHO Archive success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/bake.bat ================================================================== --- Setup/bake.bat +++ Setup/bake.bat @@ -9,11 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -40,11 +40,11 @@ SET PATH=%ProgramFiles%\Inno Setup 5;%PATH% :set_path_done %_VECHO% Path = '%PATH%' -%__ECHO% ISCC.exe "%TOOLS%\SQLite.iss" "/dAppId=%APPID%" "/dAppPublicKey=%PUBLICKEY%" "/dAppURL=%URL%" "/dIsNetFx2=%ISNETFX2%" "/dVcRuntime=%VCRUNTIME%" "/dAppConfiguration=%CONFIGURATION%" "/dAppPlatform=%PLATFORM%" "/dAppProcessor=%PROCESSOR%" "/dFramework=%FRAMEWORK%" "/dYear=%YEAR%" +%_ECHO% ISCC.exe "%TOOLS%\SQLite.iss" "/dAppId=%APPID%" "/dAppPublicKey=%PUBLICKEY%" "/dAppURL=%URL%" "/dIsNetFx2=%ISNETFX2%" "/dVcRuntime=%VCRUNTIME%" "/dAppConfiguration=%CONFIGURATION%" "/dAppPlatform=%PLATFORM%" "/dAppProcessor=%PROCESSOR%" "/dFramework=%FRAMEWORK%" "/dYear=%YEAR%" IF %ERRORLEVEL% NEQ 0 ( ECHO Failed to compile setup. GOTO errors ) @@ -51,12 +51,12 @@ GOTO no_errors :fn_SetVariable SETLOCAL - SET __ECHO_CMD=ECHO %%%2%% - FOR /F "delims=" %%V IN ('%__ECHO_CMD%') DO ( + SET _ECHO_CMD=ECHO %%%2%% + FOR /F "delims=" %%V IN ('%_ECHO_CMD%') DO ( SET VALUE=%%V ) ENDLOCAL && ( SET %1=%VALUE% ) @@ -83,6 +83,6 @@ ECHO. ECHO Bake success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/bake_all.bat ================================================================== --- Setup/bake_all.bat +++ Setup/bake_all.bat @@ -9,12 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO3=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -24,18 +23,18 @@ %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel -%__ECHO3% CALL "%TOOLS%\vsSp.bat" +%_ECHO% CALL "%TOOLS%\vsSp.bat" IF ERRORLEVEL 1 ( ECHO Could not detect Visual Studio. GOTO errors ) -%__ECHO3% CALL "%TOOLS%\set_common.bat" +%_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) @@ -59,18 +58,18 @@ %_VECHO% Years = '%YEARS%' FOR %%C IN (%BAKE_CONFIGURATIONS%) DO ( FOR %%P IN (%PROCESSORS%) DO ( FOR %%Y IN (%YEARS%) DO ( - %__ECHO3% CALL "%TOOLS%\set_%%C_%%P_%%Y.bat" + %_ECHO% CALL "%TOOLS%\set_%%C_%%P_%%Y.bat" IF ERRORLEVEL 1 ( ECHO Could not set variables for %%C/%%P/%%Y. GOTO errors ) - %__ECHO3% CALL "%TOOLS%\bake.bat" + %_ECHO% CALL "%TOOLS%\bake.bat" IF ERRORLEVEL 1 ( ECHO Could not bake setup for %%C/%%P/%%Y. GOTO errors ) @@ -101,6 +100,6 @@ ECHO. ECHO Success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/build.bat ================================================================== --- Setup/build.bat +++ Setup/build.bat @@ -9,13 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO2=ECHO -REM SET __ECHO3=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -54,11 +52,11 @@ IF EXIST "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat" ( CALL :fn_ResetErrorLevel %_AECHO% Running "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat"... - %__ECHO3% CALL "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat" + %_ECHO% CALL "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat" IF ERRORLEVEL 1 ( ECHO File "%TOOLS%\set_%CONFIGURATION%_%PLATFORM%.bat" failed. GOTO errors ) @@ -130,11 +128,11 @@ %_VECHO% Year = '%YEAR%' %_VECHO% FrameworkDir = '%FRAMEWORKDIR%' CALL :fn_ResetErrorLevel -%__ECHO2% PUSHD "%ROOT%" +%_ECHO% PUSHD "%ROOT%" IF ERRORLEVEL 1 ( ECHO Could not change directory to "%ROOT%". GOTO errors ) @@ -193,18 +191,18 @@ :skip_setLogging %_VECHO% Logging = '%LOGGING%' -%__ECHO% MSBuild.exe "%SOLUTION%" "/target:%TARGET%" "/property:Configuration=%CONFIGURATION%" "/property:Platform=%PLATFORM%" %LOGGING% %MSBUILD_ARGS% +%_ECHO% MSBuild.exe "%SOLUTION%" "/target:%TARGET%" "/property:Configuration=%CONFIGURATION%" "/property:Platform=%PLATFORM%" %LOGGING% %MSBUILD_ARGS% IF ERRORLEVEL 1 ( ECHO Build failed. GOTO errors ) -%__ECHO2% POPD +%_ECHO% POPD IF ERRORLEVEL 1 ( ECHO Could not restore directory. GOTO errors ) @@ -212,12 +210,12 @@ GOTO no_errors :fn_UnquoteVariable SETLOCAL IF NOT DEFINED %1 GOTO :EOF - SET __ECHO_CMD=ECHO %%%1%% - FOR /F "delims=" %%V IN ('%__ECHO_CMD%') DO ( + SET _ECHO_CMD=ECHO %%%1%% + FOR /F "delims=" %%V IN ('%_ECHO_CMD%') DO ( SET VALUE=%%V ) SET VALUE=%VALUE:"=% REM " ENDLOCAL && SET %1=%VALUE% @@ -257,6 +255,6 @@ ECHO. ECHO Build success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/build_all.bat ================================================================== --- Setup/build_all.bat +++ Setup/build_all.bat @@ -9,12 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO3=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -24,18 +23,18 @@ %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel -%__ECHO3% CALL "%TOOLS%\vsSp.bat" +%_ECHO% CALL "%TOOLS%\vsSp.bat" IF ERRORLEVEL 1 ( ECHO Could not detect Visual Studio. GOTO errors ) -%__ECHO3% CALL "%TOOLS%\set_common.bat" +%_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) @@ -59,18 +58,18 @@ %_VECHO% Years = '%YEARS%' FOR %%C IN (%BUILD_CONFIGURATIONS%) DO ( FOR %%P IN (%PLATFORMS%) DO ( FOR %%Y IN (%YEARS%) DO ( - %__ECHO3% CALL "%TOOLS%\set_%%Y.bat" + %_ECHO% CALL "%TOOLS%\set_%%Y.bat" IF ERRORLEVEL 1 ( ECHO Could not set variables for %%Y. GOTO errors ) - %__ECHO3% CALL "%TOOLS%\build.bat" %%C %%P + %_ECHO% CALL "%TOOLS%\build.bat" %%C %%P IF ERRORLEVEL 1 ( ECHO Could not build binaries for %%C/%%P/%%Y. GOTO errors ) @@ -101,6 +100,6 @@ ECHO. ECHO Success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/build_ce.bat ================================================================== --- Setup/build_ce.bat +++ Setup/build_ce.bat @@ -9,12 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO3=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -31,11 +30,11 @@ SET YEARS=2008 SET BASE_PLATFORM=PocketPC CALL :fn_ResetErrorLevel -%__ECHO3% CALL "%TOOLS%\build_all.bat" +%_ECHO% CALL "%TOOLS%\build_all.bat" IF ERRORLEVEL 1 ( ECHO Failed to build PocketPC binaries. GOTO errors ) @@ -67,6 +66,6 @@ ECHO. ECHO Build success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/clean.bat ================================================================== --- Setup/clean.bat +++ Setup/clean.bat @@ -9,11 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -58,11 +58,11 @@ %_AECHO%. FOR %%D IN (%CLEANDIRS%) DO ( IF EXIST "%SOURCE%\%%D" ( - %__ECHO% RMDIR /S /Q "%SOURCE%\%%D" + %_ECHO% RMDIR /S /Q "%SOURCE%\%%D" IF ERRORLEVEL 1 ( ECHO Could not remove directory "%SOURCE%\%%D". ECHO. GOTO errors @@ -75,11 +75,11 @@ %_AECHO%. ) ) IF EXIST "%SOURCE%\*.nupkg" ( - %__ECHO% DEL /Q "%SOURCE%\*.nupkg" + %_ECHO% DEL /Q "%SOURCE%\*.nupkg" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\*.nupkg". ECHO. GOTO errors @@ -91,11 +91,11 @@ %_AECHO% No files matching "%SOURCE%\*.nupkg" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Doc\SQLite.NET.chw" ( - %__ECHO% DEL /Q "%SOURCE%\Doc\SQLite.NET.chw" + %_ECHO% DEL /Q "%SOURCE%\Doc\SQLite.NET.chw" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Doc\SQLite.NET.chw". ECHO. GOTO errors @@ -107,11 +107,11 @@ %_AECHO% No files matching "%SOURCE%\Doc\SQLite.NET.chw" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Externals\Eagle\bin\sqlite3.*" ( - %__ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\sqlite3.*" + %_ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\sqlite3.*" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Externals\Eagle\bin\sqlite3.*". ECHO. GOTO errors @@ -123,11 +123,11 @@ %_AECHO% No files matching "%SOURCE%\Externals\Eagle\bin\sqlite3.*" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*" ( - %__ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*" + %_ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*". ECHO. GOTO errors @@ -139,11 +139,11 @@ %_AECHO% No files matching "%SOURCE%\Externals\Eagle\bin\SQLite.Interop.*" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*" ( - %__ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*" + %_ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*". ECHO. GOTO errors @@ -155,11 +155,11 @@ %_AECHO% No files matching "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.*" exist. %_AECHO%. ) IF EXIST "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*" ( - %__ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*" + %_ECHO% DEL /Q "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*" IF ERRORLEVEL 1 ( ECHO Could not delete "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*". ECHO. GOTO errors @@ -171,11 +171,11 @@ %_AECHO% No files matching "%SOURCE%\Externals\Eagle\bin\System.Data.SQLite.Linq.*" exist. %_AECHO%. ) IF EXIST "%TEMP%\EagleShell.exe.test.*.log" ( - %__ECHO% DEL /Q "%TEMP%\EagleShell.exe.test.*.log" + %_ECHO% DEL /Q "%TEMP%\EagleShell.exe.test.*.log" IF ERRORLEVEL 1 ( ECHO Could not delete "%TEMP%\EagleShell.exe.test.*.log". ECHO. GOTO errors @@ -187,11 +187,11 @@ %_AECHO% No files matching "%TEMP%\EagleShell.exe.test.*.log" exist. %_AECHO%. ) IF EXIST "%TEMP%\mono.exe.test.*.log" ( - %__ECHO% DEL /Q "%TEMP%\mono.exe.test.*.log" + %_ECHO% DEL /Q "%TEMP%\mono.exe.test.*.log" IF ERRORLEVEL 1 ( ECHO Could not delete "%TEMP%\mono.exe.test.*.log". ECHO. GOTO errors @@ -203,11 +203,11 @@ %_AECHO% No files matching "%TEMP%\mono.exe.test.*.log" exist. %_AECHO%. ) IF EXIST "%TEMP%\tclsh*.exe.test.*.log" ( - %__ECHO% DEL /Q "%TEMP%\tclsh*.exe.test.*.log" + %_ECHO% DEL /Q "%TEMP%\tclsh*.exe.test.*.log" IF ERRORLEVEL 1 ( ECHO Could not delete "%TEMP%\tclsh*.exe.test.*.log". ECHO. GOTO errors @@ -251,6 +251,6 @@ ECHO. ECHO Clean success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/release.bat ================================================================== --- Setup/release.bat +++ Setup/release.bat @@ -9,13 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO2=ECHO -REM SET __ECHO3=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -82,11 +80,11 @@ %_VECHO% Type = '%TYPE%' CALL :fn_ResetErrorLevel -%__ECHO3% CALL "%TOOLS%\set_common.bat" +%_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) @@ -110,11 +108,11 @@ %_VECHO% Root = '%ROOT%' %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel -%__ECHO2% PUSHD "%ROOT%" +%_ECHO% PUSHD "%ROOT%" IF ERRORLEVEL 1 ( ECHO Could not change directory to "%ROOT%". GOTO errors ) @@ -148,44 +146,38 @@ %_VECHO% Version = '%VERSION%' CALL :fn_ResetErrorLevel IF NOT EXIST Setup\Output ( - %__ECHO% MKDIR Setup\Output + %_ECHO% MKDIR Setup\Output IF ERRORLEVEL 1 ( ECHO Could not create directory "Setup\Output". GOTO errors ) ) IF DEFINED BASE_CONFIGURATIONSUFFIX ( - FOR /F "delims=" %%F IN ('DIR /B /S /AD "bin\%YEAR%\%BASE_CONFIGURATION%%BASE_CONFIGURATIONSUFFIX%\bin" 2^> NUL') DO ( - %__ECHO% RMDIR /S /Q "%%F" - ) - %__ECHO% zip.exe -v -j -r "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" "bin\%YEAR%\%BASE_CONFIGURATION%%BASE_CONFIGURATIONSUFFIX%\bin" -x @exclude_bin.txt + %_ECHO% zip.exe -v -j -r "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" "bin\%YEAR%\%BASE_CONFIGURATION%%BASE_CONFIGURATIONSUFFIX%\bin" -x @exclude_bin.txt ) ELSE ( - FOR /F "delims=" %%F IN ('DIR /B /S /AD "bin\%YEAR%\%BASE_CONFIGURATION%\bin" 2^> NUL') DO ( - %__ECHO% RMDIR /S /Q "%%F" - ) - %__ECHO% zip.exe -v -j -r "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" "bin\%YEAR%\%BASE_CONFIGURATION%\bin" -x @exclude_bin.txt + %_ECHO% zip.exe -v -j -r "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" "bin\%YEAR%\%BASE_CONFIGURATION%\bin" -x @exclude_bin.txt ) IF /I "%CONFIGURATION%" == "%BASE_CONFIGURATION%" ( IF NOT DEFINED BASE_CONFIGURATIONSUFFIX ( - %__ECHO% zip -v -d "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" SQLite.Interop.* + %_ECHO% zip -v -d "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" SQLite.Interop.* ) ) -%__ECHO% zip.exe -v -j -r "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" "bin\%YEAR%\%PLATFORM%\%CONFIGURATION%%CONFIGURATIONSUFFIX%" -x @exclude_bin.txt +%_ECHO% zip.exe -v -j -r "Setup\Output\sqlite-%FRAMEWORK%-%TYPE%-%BASE_PLATFORM%-%YEAR%-%VERSION%.zip" "bin\%YEAR%\%PLATFORM%\%CONFIGURATION%%CONFIGURATIONSUFFIX%" -x @exclude_bin.txt IF ERRORLEVEL 1 ( ECHO Failed to archive binary files. GOTO errors ) -%__ECHO2% POPD +%_ECHO% POPD IF ERRORLEVEL 1 ( ECHO Could not restore directory. GOTO errors ) @@ -192,12 +184,12 @@ GOTO no_errors :fn_SetVariable SETLOCAL - SET __ECHO_CMD=ECHO %%%2%% - FOR /F "delims=" %%V IN ('%__ECHO_CMD%') DO ( + SET _ECHO_CMD=ECHO %%%2%% + FOR /F "delims=" %%V IN ('%_ECHO_CMD%') DO ( SET VALUE=%%V ) ENDLOCAL && ( SET %1=%VALUE% ) @@ -204,12 +196,12 @@ GOTO :EOF :fn_UnquoteVariable SETLOCAL IF NOT DEFINED %1 GOTO :EOF - SET __ECHO_CMD=ECHO %%%1%% - FOR /F "delims=" %%V IN ('%__ECHO_CMD%') DO ( + SET _ECHO_CMD=ECHO %%%1%% + FOR /F "delims=" %%V IN ('%_ECHO_CMD%') DO ( SET VALUE=%%V ) SET VALUE=%VALUE:"=% REM " ENDLOCAL && SET %1=%VALUE% @@ -242,6 +234,6 @@ ECHO. ECHO Release success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/release_all.bat ================================================================== --- Setup/release_all.bat +++ Setup/release_all.bat @@ -9,12 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO3=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -24,18 +23,18 @@ %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel -%__ECHO3% CALL "%TOOLS%\vsSp.bat" +%_ECHO% CALL "%TOOLS%\vsSp.bat" IF ERRORLEVEL 1 ( ECHO Could not detect Visual Studio. GOTO errors ) -%__ECHO3% CALL "%TOOLS%\set_common.bat" +%_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) @@ -59,11 +58,11 @@ %_VECHO% Years = '%YEARS%' FOR %%C IN (%RELEASE_CONFIGURATIONS%) DO ( FOR %%P IN (%PLATFORMS%) DO ( FOR %%Y IN (%YEARS%) DO ( - %__ECHO3% CALL "%TOOLS%\release.bat" %%C %%P %%Y + %_ECHO% CALL "%TOOLS%\release.bat" %%C %%P %%Y IF ERRORLEVEL 1 ( ECHO Could not build release archive for %%C/%%P/%%Y. GOTO errors ) @@ -94,6 +93,6 @@ ECHO. ECHO Success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/release_ce.bat ================================================================== --- Setup/release_ce.bat +++ Setup/release_ce.bat @@ -9,12 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO3=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -32,11 +31,11 @@ SET BASE_PLATFORM=PocketPC SET TYPE=binary CALL :fn_ResetErrorLevel -%__ECHO3% CALL "%TOOLS%\release_all.bat" +%_ECHO% CALL "%TOOLS%\release_all.bat" IF ERRORLEVEL 1 ( ECHO Failed to build PocketPC release files. GOTO errors ) @@ -68,6 +67,6 @@ ECHO. ECHO Release success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/release_static.bat ================================================================== --- Setup/release_static.bat +++ Setup/release_static.bat @@ -9,12 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO3=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -27,11 +26,11 @@ SET CONFIGURATIONSUFFIX=Static SET TYPE_PREFIX=static- CALL :fn_ResetErrorLevel -%__ECHO3% CALL "%TOOLS%\release_all.bat" +%_ECHO% CALL "%TOOLS%\release_all.bat" IF ERRORLEVEL 1 ( ECHO Failed to build static release files. GOTO errors ) @@ -63,6 +62,6 @@ ECHO. ECHO Release success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/test_all.bat ================================================================== --- Setup/test_all.bat +++ Setup/test_all.bat @@ -9,13 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO -REM SET __ECHO2=ECHO -REM SET __ECHO3=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* @@ -44,18 +42,18 @@ %_VECHO% Tools = '%TOOLS%' CALL :fn_ResetErrorLevel -%__ECHO3% CALL "%TOOLS%\vsSp.bat" +%_ECHO% CALL "%TOOLS%\vsSp.bat" IF ERRORLEVEL 1 ( ECHO Could not detect Visual Studio. GOTO errors ) -%__ECHO3% CALL "%TOOLS%\set_common.bat" +%_ECHO% CALL "%TOOLS%\set_common.bat" IF ERRORLEVEL 1 ( ECHO Could not set common variables. GOTO errors ) @@ -79,82 +77,62 @@ GOTO errors ) %_VECHO% Platform = '%PLATFORM%' -%__ECHO2% PUSHD "%ROOT%" +%_ECHO% PUSHD "%ROOT%" IF ERRORLEVEL 1 ( ECHO Could not change directory to "%ROOT%". GOTO errors ) FOR %%Y IN (%YEARS%) DO ( - IF NOT DEFINED NOMANAGEDONLY ( - %__ECHO% Externals\Eagle\bin\EagleShell.exe -preInitialize "set test_year {%%Y}" -file Tests\all.eagle - - IF ERRORLEVEL 1 ( - ECHO Testing of "%%Y" managed-only assembly failed. - GOTO errors - ) - ) - - IF NOT DEFINED NOMIXEDMODE ( - IF NOT DEFINED NOXCOPY ( - %__ECHO% XCOPY "bin\%%Y\Release\bin\test.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% - - IF ERRORLEVEL 1 ( - ECHO Failed to copy "bin\%%Y\Release\bin\test.*" to "bin\%%Y\%PLATFORM%\Release". - GOTO errors - ) - - %__ECHO% XCOPY "bin\%%Y\Release\bin\System.Data.SQLite.Linq.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% - - IF ERRORLEVEL 1 ( - ECHO Failed to copy "bin\%%Y\Release\bin\System.Data.SQLite.Linq.*" to "bin\%%Y\%PLATFORM%\Release". - GOTO errors - ) - - %__ECHO% XCOPY "bin\%%Y\Release\bin\testlinq.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% - - IF ERRORLEVEL 1 ( - ECHO Failed to copy "bin\%%Y\Release\bin\testlinq.*" to "bin\%%Y\%PLATFORM%\Release". - GOTO errors - ) - - %__ECHO% XCOPY "bin\%%Y\Release\bin\northwindEF.db" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% - - IF ERRORLEVEL 1 ( - ECHO Failed to copy "bin\%%Y\Release\bin\northwindEF.db" to "bin\%%Y\%PLATFORM%\Release". - GOTO errors - ) - - %__ECHO% XCOPY "bin\%%Y\Release\bin\SQLite.Designer.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% - - IF ERRORLEVEL 1 ( - ECHO Failed to copy "bin\%%Y\Release\bin\SQLite.Designer.*" to "bin\%%Y\%PLATFORM%\Release". - GOTO errors - ) - - %__ECHO% XCOPY "bin\%%Y\Release\bin\Installer.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% - - IF ERRORLEVEL 1 ( - ECHO Failed to copy "bin\%%Y\Release\bin\Installer.*" to "bin\%%Y\%PLATFORM%\Release". - GOTO errors - ) - ) - - %__ECHO% Externals\Eagle\bin\EagleShell.exe -preInitialize "set test_year {%%Y}" -initialize -runtimeOption native -file Tests\all.eagle - - IF ERRORLEVEL 1 ( - ECHO Testing of "%%Y" mixed-mode assembly failed. - GOTO errors - ) - ) -) - -%__ECHO2% POPD + %_ECHO% Externals\Eagle\bin\EagleShell.exe -preInitialize "set test_year {%%Y}" -file Tests\all.eagle + + IF ERRORLEVEL 1 ( + ECHO Testing of "%%Y" managed-only assembly failed. + GOTO errors + ) + + %_ECHO% XCOPY "bin\%%Y\Release\bin\test.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% + + IF ERRORLEVEL 1 ( + ECHO Failed to copy "bin\%%Y\Release\bin\test.*" to "bin\%%Y\%PLATFORM%\Release". + GOTO errors + ) + + %_ECHO% XCOPY "bin\%%Y\Release\bin\System.Data.SQLite.Linq.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% + + IF ERRORLEVEL 1 ( + ECHO Failed to copy "bin\%%Y\Release\bin\System.Data.SQLite.Linq.*" to "bin\%%Y\%PLATFORM%\Release". + GOTO errors + ) + + %_ECHO% XCOPY "bin\%%Y\Release\bin\testlinq.*" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% + + IF ERRORLEVEL 1 ( + ECHO Failed to copy "bin\%%Y\Release\bin\testlinq.*" to "bin\%%Y\%PLATFORM%\Release". + GOTO errors + ) + + %_ECHO% XCOPY "bin\%%Y\Release\bin\northwindEF.db" "bin\%%Y\%PLATFORM%\Release" %FFLAGS% %DFLAGS% + + IF ERRORLEVEL 1 ( + ECHO Failed to copy "bin\%%Y\Release\bin\northwindEF.db" to "bin\%%Y\%PLATFORM%\Release". + GOTO errors + ) + + %_ECHO% Externals\Eagle\bin\EagleShell.exe -preInitialize "set test_year {%%Y}" -initialize -runtimeOption native -file Tests\all.eagle + + IF ERRORLEVEL 1 ( + ECHO Testing of "%%Y" mixed-mode assembly failed. + GOTO errors + ) +) + +%_ECHO% POPD IF ERRORLEVEL 1 ( ECHO Could not restore directory. GOTO errors ) @@ -187,6 +165,6 @@ ECHO. ECHO Test success, no errors were encountered. GOTO end_of_file :end_of_file -%__ECHO% EXIT /B %ERRORLEVEL% +%_ECHO% EXIT /B %ERRORLEVEL% Index: Setup/updateFileInfo.tcl ================================================================== --- Setup/updateFileInfo.tcl +++ Setup/updateFileInfo.tcl @@ -103,11 +103,11 @@ foreach {dummy fileName fileSize fileHash} \ [regexp -all -inline -nocase -- $pattern $data] { # # NOTE: Get the fully qualified file name based on the configured directory. # - set fullFileName [file join $directory [file tail $fileName]] + set fullFileName [file join $directory $fileName] # # NOTE: If the file does not exist, issue a warning and skip it. # if {![file exists $fullFileName]} then { DELETED Setup/verify.eagle Index: Setup/verify.eagle ================================================================== --- Setup/verify.eagle +++ /dev/null @@ -1,194 +0,0 @@ -############################################################################### -# -# verify.eagle -- Release Archive Verification Tool -# -# Written by Joe Mistachkin. -# Released to the public domain, use at your own risk! -# -############################################################################### - -package require Eagle - -proc usage { error } { - if {[string length $error] > 0} then {puts stdout $error} - - puts stdout "usage:\ -[file tail [info nameofexecutable]]\ -[file tail [info script]] " - - # - # NOTE: Indicate to the caller, if any, that we have failed. - # - exit 1 -} - -set argc [llength $argv] - -if {$argc == 1} then { - set directory [lindex $argv 0] - - if {[string length $directory] > 0} then { - set exitCode 0 - - set script [info script] - set path [file dirname $script] - set rootName [file rootname [file tail $script]] - - if {![info exists rar]} then { - if {[info exists env(UnRAR)]} then { - set rar $env(UnRAR) - } - - if {![info exists rar] || ![file exists $rar]} then { - set rar [file join $path UnRAR.exe] - } - } - - if {![info exists zip]} then { - if {[info exists env(UnZip)]} then { - set zip $env(UnZip) - } - - if {![info exists zip] || ![file exists $zip]} then { - set zip [file join $path UnZip.exe] - } - } - - source [file join $path [appendArgs $rootName .lst]] - - if {![array exists manifests]} then { - usage "master archive manifest is missing" - } - - set archiveFileNames [list] - - foreach extension [list exe rar zip] { - eval lappend archiveFileNames [findFilesRecursive \ - [file join $directory [appendArgs *. $extension]]] - } - - foreach archiveFileName $archiveFileNames { - set manifest [file tail $archiveFileName] - - # - # HACK: Skip all the Inno Setup files because we cannot - # easily validate them from this tool. - # - if {[string match -nocase *Setup*.exe $manifest]} then { - continue - } - - # - # NOTE: Attempt to extract the version and/or date/time - # information from the manifest file name. - # - regexp -- {(\d+)\.(\d+)\.(\d+)\.(\d+)} $manifest dummy \ - major minor build revision - - regexp -- {(\d{4})-(\d{2})-(\d{2})-(\d{2})} $manifest \ - dummy year month day sequence - - # - # HACK: Attempt to match and remove sub-strings from the - # manifest file name that look like a version number - # in the format "..." - # and/or a date/time string matching the format - # "YYYY-MM-DD-NN" (where the NN portion is a generic - # incrementing sequence number). - # - regsub -- {\d+\.\d+\.\d+\.\d+} $manifest {} manifest - regsub -- {\d{4}-\d{2}-\d{2}-\d{2}} $manifest {} manifest - - if {![info exists manifests($manifest)]} then { - puts stdout [appendArgs \ - "WARNING: Cannot find master manifest \"" \ - $manifest "\" for archive \"" $archiveFileName \ - "\", skipped."] - - continue - } - - set manifestFileNames [list] - - foreach list [lrange $manifests($manifest) 1 end] { - set rawManifestFileNames [set [appendArgs \ - [appendArgs [lindex $manifests($manifest) 0] \ - _manifests] ( $list )]] - - if {[info exists manifests($manifest,subst)]} then { - set rawManifestFileNames [subst $rawManifestFileNames] - } - - foreach manifestFileName $rawManifestFileNames { - lappend manifestFileNames $manifestFileName - } - } - - set listCommand [list] - lappend listCommand exec -success Success -nocarriagereturns -- - - if {[file extension $archiveFileName] eq ".zip"} then { - if {![file exists $zip]} then { - usage [appendArgs "tool \"" $zip "\" is missing"] - } - - lappend listCommand $zip -Z -1 $archiveFileName - } else { - if {![file exists $rar]} then { - usage [appendArgs "tool \"" $rar "\" is missing"] - } - - lappend listCommand $rar vb -- $archiveFileName - } - - if {[catch {eval $listCommand} result] == 0} then { - set containedFileNames [split [string map [list \\ /] \ - [string trim $result]] \n] - - foreach manifestFileName $manifestFileNames { - # - # TODO: Should we use -nocase here because Windows - # is the primary release platform? - # - if {[lsearch -exact -- $containedFileNames \ - $manifestFileName] == -1} then { - puts stdout [appendArgs \ - "ERROR: Archive \"" $archiveFileName \ - "\" missing file \"" $manifestFileName \ - "\" from manifest \"" $manifest "\"."] - - set exitCode 1 - } - } - - foreach containedFileName $containedFileNames { - # - # TODO: Should we use -nocase here because Windows - # is the primary release platform? - # - if {[lsearch -exact -- $manifestFileNames \ - $containedFileName] == -1} then { - puts stdout [appendArgs \ - "ERROR: Archive \"" $archiveFileName \ - "\" contains file \"" $containedFileName \ - "\" not in manifest \"" $manifest "\"."] - - set exitCode 1 - } - } - } else { - puts stdout [appendArgs \ - "ERROR: Failed to get list of files in archive \"" \ - $archiveFileName "\", error: " $result] - - set exitCode 1 - } - } - - exit $exitCode - } else { - usage "invalid directory" - } -} else { - usage "" -} DELETED Setup/verify.lst Index: Setup/verify.lst ================================================================== --- Setup/verify.lst +++ /dev/null @@ -1,524 +0,0 @@ -############################################################################### -# -# verify.lst -- Release Archive Manifest -# -# Written by Joe Mistachkin. -# Released to the public domain, use at your own risk! -# -############################################################################### -# -# NOTE: This file contains the master lists of all files that should be present -# in the various archives generated during the release process. -# -############################################################################### -# -# NOTE: This is the list of all files that should be present in the source code -# archive. -# -set sds_manifests(source) { - Doc/ - Doc/buildChm.tcl - Doc/Extra/ - Doc/Extra/dbfactorysupport.html - Doc/Extra/designer.html - Doc/Extra/lang_altertable.html - Doc/Extra/lang_analyze.html - Doc/Extra/lang_attach.html - Doc/Extra/lang_comment.html - Doc/Extra/lang_conflict.html - Doc/Extra/lang_createindex.html - Doc/Extra/lang_createtable.html - Doc/Extra/lang_createtrigger.html - Doc/Extra/lang_createview.html - Doc/Extra/lang_createvtab.html - Doc/Extra/lang_datetime.html - Doc/Extra/lang_delete.html - Doc/Extra/lang_detach.html - Doc/Extra/lang_dropindex.html - Doc/Extra/lang_droptable.html - Doc/Extra/lang_droptrigger.html - Doc/Extra/lang_dropview.html - Doc/Extra/lang_explain.html - Doc/Extra/lang_expr.html - Doc/Extra/lang_insert.html - Doc/Extra/lang_reindex.html - Doc/Extra/lang_replace.html - Doc/Extra/lang_select.html - Doc/Extra/lang_transaction.html - Doc/Extra/lang_types.html - Doc/Extra/lang_update.html - Doc/Extra/lang_vacuum.html - Doc/Extra/limitations.html - Doc/Extra/ndoc.css - Doc/Extra/optimizing.html - Doc/Extra/pragma.html - Doc/Extra/syntax.html - Doc/Extra/version.html - Doc/Extra/welcome.html - Doc/SQLite.NET.chm - Doc/SQLite.NET.hhc - Doc/SQLite.NET.hhp - Doc/SQLite.NET.ndoc - exclude_bin.txt - exclude_src.txt - Externals/ - Externals/Eagle/ - Externals/Eagle/bin/ - Externals/Eagle/bin/EagleShell.exe.config - Externals/Eagle/bin/EagleShell.exe.mda.config - Externals/Eagle/lib/ - Externals/Eagle/lib/Eagle1.0/ - Externals/Eagle/lib/Eagle1.0/vendor.eagle - Externals/Eagle/lib/Test1.0/ - readme.htm - Setup/ - Setup/archive.bat - Setup/bake.bat - Setup/bake_all.bat - Setup/build.bat - Setup/build_all.bat - Setup/build_ce.bat - Setup/CheckForNetFx.pas - Setup/clean.bat - Setup/InitializeSetup.pas - Setup/release.bat - Setup/release_all.bat - Setup/release_ce.bat - Setup/release_static.bat - Setup/set_2008.bat - Setup/set_2010.bat - Setup/set_common.bat - Setup/set_netFx20.bat - Setup/set_netFx40.bat - Setup/set_Release.bat - Setup/set_ReleaseNativeOnly.bat - "Setup/set_ReleaseNativeOnly_Pocket PC 2003 (ARMV4).bat" - Setup/set_ReleaseNativeOnly_Win32.bat - Setup/set_ReleaseNativeOnly_x64.bat - Setup/set_ReleaseNativeOnly_x64_2008.bat - Setup/set_ReleaseNativeOnly_x64_2010.bat - Setup/set_ReleaseNativeOnly_x86_2008.bat - Setup/set_ReleaseNativeOnly_x86_2010.bat - "Setup/set_Release_Pocket PC 2003 (ARMV4).bat" - Setup/set_Release_Win32.bat - Setup/set_Release_x64.bat - Setup/set_Release_x64_2008.bat - Setup/set_Release_x64_2010.bat - Setup/set_Release_x86_2008.bat - Setup/set_Release_x86_2010.bat - Setup/set_x64_2008.bat - Setup/set_x64_2010.bat - Setup/set_x86_2008.bat - Setup/set_x86_2010.bat - Setup/SQLite.iss - Setup/test_all.bat - Setup/updateFileInfo.tcl - Setup/verify.eagle - Setup/verify.lst - Setup/vsSp.bat - SQLite.Designer/ - SQLite.Designer/AssemblyInfo.cs - SQLite.Designer/ChangePasswordDialog.cs - SQLite.Designer/ChangePasswordDialog.Designer.cs - SQLite.Designer/ChangePasswordDialog.resx - SQLite.Designer/ChangeScriptDialog.cs - SQLite.Designer/ChangeScriptDialog.Designer.cs - SQLite.Designer/ChangeScriptDialog.resx - SQLite.Designer/CtcComponents/ - SQLite.Designer/CtcComponents/Guids.h - SQLite.Designer/CtcComponents/PkgCmd.ctc - SQLite.Designer/CtcComponents/PkgCmdID.h - SQLite.Designer/Design/ - SQLite.Designer/Design/Check.cs - SQLite.Designer/Design/Column.cs - SQLite.Designer/Design/ForeignKey.cs - SQLite.Designer/Design/Index.cs - SQLite.Designer/Design/PrimaryKey.cs - SQLite.Designer/Design/SimpleTokenizer.cs - SQLite.Designer/Design/Table.cs - SQLite.Designer/Design/Trigger.cs - SQLite.Designer/Design/Unique.cs - SQLite.Designer/Design/View.cs - SQLite.Designer/Editors/ - SQLite.Designer/Editors/AutoCompleteColumn.cs - SQLite.Designer/Editors/TableDesignerDoc.cs - SQLite.Designer/Editors/TableDesignerDoc.Designer.cs - SQLite.Designer/Editors/TableDesignerDoc.resx - SQLite.Designer/Editors/ViewDesignerDoc.cs - SQLite.Designer/Editors/ViewDesignerDoc.Designer.cs - SQLite.Designer/Editors/ViewDesignerDoc.resx - SQLite.Designer/Pkgcmd.h - SQLite.Designer/PkgCmd.vsct - SQLite.Designer/plk.txt - SQLite.Designer/Resources/ - SQLite.Designer/Resources/info.png - SQLite.Designer/Resources/ToolboxItems.txt - SQLite.Designer/source.extension.vsixmanifest - SQLite.Designer/SQLite.Designer.2005.csproj - SQLite.Designer/SQLite.Designer.2008.csproj - SQLite.Designer/SQLite.Designer.2010.csproj - SQLite.Designer/SQLiteAdapterDesigner.cs - SQLite.Designer/SQLiteCommandDesigner.cs - SQLite.Designer/SQLiteCommandHandler.cs - SQLite.Designer/SQLiteConnectionProperties.cs - SQLite.Designer/SQLiteConnectionStringEditor.cs - SQLite.Designer/SQLiteConnectionUIControl.cs - SQLite.Designer/SQLiteConnectionUIControl.Designer.cs - SQLite.Designer/SQLiteConnectionUIControl.resx - SQLite.Designer/SQLiteDataAdapterToolboxItem.cs - SQLite.Designer/SQLiteDataConnectionSupport.cs - SQLite.Designer/SQLiteDataObjectIdentifierResolver.cs - SQLite.Designer/SQLiteDataObjectSupport.cs - SQLite.Designer/SQLiteDataObjectSupport.xml - SQLite.Designer/SQLiteDataSourceInformation.cs - SQLite.Designer/SQLiteDataViewSupport.cs - SQLite.Designer/SQLiteDataViewSupport2005.xml - SQLite.Designer/SQLiteDataViewSupport2008.xml - SQLite.Designer/SQLiteDataViewSupport2010.xml - SQLite.Designer/SQLitePackage.cs - SQLite.Designer/SQLiteProviderObjectFactory.cs - SQLite.Designer/TableNameDialog.cs - SQLite.Designer/TableNameDialog.Designer.cs - SQLite.Designer/TableNameDialog.resx - SQLite.Designer/VSPackage.Designer.cs - SQLite.Designer/VSPackage.resx - SQLite.Interop/ - SQLite.Interop/props/ - SQLite.Interop/props/SQLite.Interop.2005.vsprops - SQLite.Interop/props/SQLite.Interop.2008.vsprops - SQLite.Interop/props/SQLite.Interop.2010.props - SQLite.Interop/props/sqlite3.props - SQLite.Interop/props/sqlite3.vsprops - SQLite.Interop/SQLite.Interop.2005.vcproj - SQLite.Interop/SQLite.Interop.2008.vcproj - SQLite.Interop/SQLite.Interop.2010.vcxproj - SQLite.Interop/SQLite.Interop.2010.vcxproj.filters - SQLite.Interop/SQLite.Interop.CE.2005.vcproj - SQLite.Interop/SQLite.Interop.CE.2008.vcproj - SQLite.Interop/SQLite.Interop.Static.2005.vcproj - SQLite.Interop/SQLite.Interop.Static.2008.vcproj - SQLite.Interop/SQLite.Interop.Static.2010.vcxproj - SQLite.Interop/SQLite.Interop.Static.2010.vcxproj.filters - SQLite.Interop/src/ - SQLite.Interop/src/contrib/ - SQLite.Interop/src/contrib/extension-functions.c - SQLite.Interop/src/core/ - SQLite.Interop/src/core/sqlite3.c - SQLite.Interop/src/core/sqlite3.h - SQLite.Interop/src/core/sqlite3ext.h - SQLite.Interop/src/win/ - SQLite.Interop/src/win/AssemblyInfo.cpp - SQLite.Interop/src/win/crypt.c - SQLite.Interop/src/win/interop.c - SQLite.Interop/src/win/interop.h - SQLite.Interop/src/win/SQLite.Interop.rc - SQLite.MSIL.nuspec - SQLite.NET.2005.MSBuild.sln - SQLite.NET.2005.sln - SQLite.NET.2008.MSBuild.sln - SQLite.NET.2008.sln - SQLite.NET.2010.MSBuild.sln - SQLite.NET.2010.sln - SQLite.NET.Settings.targets - SQLite.NET.targets - SQLite.nuspec - SQLite.x64.nuspec - SQLite.x86.nuspec - System.Data.SQLite/ - System.Data.SQLite/AssemblyInfo.cs - System.Data.SQLite/DataTypes.xml - System.Data.SQLite/LINQ/ - System.Data.SQLite/LINQ/SQLiteConnection_Linq.cs - System.Data.SQLite/LINQ/SQLiteFactory_Linq.cs - System.Data.SQLite/MetaDataCollections.xml - System.Data.SQLite/SQLite3.cs - System.Data.SQLite/SQLite3_UTF16.cs - System.Data.SQLite/SQLiteBackup.cs - System.Data.SQLite/SQLiteBase.cs - System.Data.SQLite/SQLiteCommand.bmp - System.Data.SQLite/SQLiteCommand.cs - System.Data.SQLite/SQLiteCommandBuilder.cs - System.Data.SQLite/SQLiteConnection.bmp - System.Data.SQLite/SQLiteConnection.cs - System.Data.SQLite/SQLiteConnectionPool.cs - System.Data.SQLite/SQLiteConnectionStringBuilder.cs - System.Data.SQLite/SQLiteConvert.cs - System.Data.SQLite/SQLiteDataAdapter.bmp - System.Data.SQLite/SQLiteDataAdapter.cs - System.Data.SQLite/SQLiteDataReader.cs - System.Data.SQLite/SQLiteDefineConstants.cs - System.Data.SQLite/SQLiteEnlistment.cs - System.Data.SQLite/SQLiteException.cs - System.Data.SQLite/SQLiteFactory.cs - System.Data.SQLite/SQLiteFunction.cs - System.Data.SQLite/SQLiteFunctionAttribute.cs - System.Data.SQLite/SQLiteKeyReader.cs - System.Data.SQLite/SQLiteLog.cs - System.Data.SQLite/SQLiteMetaDataCollectionNames.cs - System.Data.SQLite/SQLiteParameter.cs - System.Data.SQLite/SQLiteParameterCollection.cs - System.Data.SQLite/SQLiteStatement.cs - System.Data.SQLite/SQLiteTransaction.cs - System.Data.SQLite/SR.Designer.cs - System.Data.SQLite/SR.resx - System.Data.SQLite/System.Data.SQLite.2005.csproj - System.Data.SQLite/System.Data.SQLite.2008.csproj - System.Data.SQLite/System.Data.SQLite.2010.csproj - System.Data.SQLite/System.Data.SQLite.CF.snk - System.Data.SQLite/System.Data.SQLite.Compact.2005.csproj - System.Data.SQLite/System.Data.SQLite.Compact.2008.csproj - System.Data.SQLite/System.Data.SQLite.Files.targets - System.Data.SQLite/System.Data.SQLite.Module.2005.csproj - System.Data.SQLite/System.Data.SQLite.Module.2008.csproj - System.Data.SQLite/System.Data.SQLite.Module.2010.csproj - System.Data.SQLite/System.Data.SQLite.Properties.targets - System.Data.SQLite/System.Data.SQLite.References.targets - System.Data.SQLite/System.Data.SQLite.snk - System.Data.SQLite/UnsafeNativeMethods.cs - System.Data.SQLite.Linq/ - System.Data.SQLite.Linq/AssemblyInfo.cs - System.Data.SQLite.Linq/Properties/ - System.Data.SQLite.Linq/Properties/Resources.Designer.cs - System.Data.SQLite.Linq/Properties/Resources.resx - System.Data.SQLite.Linq/Resources/ - System.Data.SQLite.Linq/Resources/Common.ConceptualSchemaDefinition.csdl - System.Data.SQLite.Linq/Resources/Common.ProviderManifest.xsd - System.Data.SQLite.Linq/Resources/SQLiteProviderServices.ProviderManifest.xml - System.Data.SQLite.Linq/Resources/SQLiteProviderServices.StoreSchemaDefinition.ssdl - System.Data.SQLite.Linq/Resources/SQLiteProviderServices.StoreSchemaMapping.msl - System.Data.SQLite.Linq/Resources/System.Data.Resources.CodeGenerationSchema.xsd - System.Data.SQLite.Linq/Resources/System.Data.Resources.CSDLSchema.xsd - System.Data.SQLite.Linq/Resources/System.Data.Resources.CSMSL.xsd - System.Data.SQLite.Linq/Resources/System.Data.Resources.EntityStoreSchemaGenerator.xsd - System.Data.SQLite.Linq/Resources/System.Data.Resources.SSDLSchema.xsd - "System.Data.SQLite.Linq/SQL Generation/" - "System.Data.SQLite.Linq/SQL Generation/DmlSqlGenerator.cs" - "System.Data.SQLite.Linq/SQL Generation/InternalBase.cs" - "System.Data.SQLite.Linq/SQL Generation/ISqlFragment.cs" - "System.Data.SQLite.Linq/SQL Generation/JoinSymbol.cs" - "System.Data.SQLite.Linq/SQL Generation/KeyToListMap.cs" - "System.Data.SQLite.Linq/SQL Generation/License.txt" - "System.Data.SQLite.Linq/SQL Generation/MetadataHelpers.cs" - "System.Data.SQLite.Linq/SQL Generation/SkipClause.cs" - "System.Data.SQLite.Linq/SQL Generation/SqlBuilder.cs" - "System.Data.SQLite.Linq/SQL Generation/SqlChecker.cs" - "System.Data.SQLite.Linq/SQL Generation/SqlGenerator.cs" - "System.Data.SQLite.Linq/SQL Generation/SqlSelectStatement.cs" - "System.Data.SQLite.Linq/SQL Generation/SqlWriter.cs" - "System.Data.SQLite.Linq/SQL Generation/StringUtil.cs" - "System.Data.SQLite.Linq/SQL Generation/Symbol.cs" - "System.Data.SQLite.Linq/SQL Generation/SymbolPair.cs" - "System.Data.SQLite.Linq/SQL Generation/SymbolTable.cs" - "System.Data.SQLite.Linq/SQL Generation/TopClause.cs" - System.Data.SQLite.Linq/SQLiteProviderManifest.cs - System.Data.SQLite.Linq/SQLiteProviderServices.cs - System.Data.SQLite.Linq/System.Data.SQLite.Linq.2008.csproj - System.Data.SQLite.Linq/System.Data.SQLite.Linq.2010.csproj - test/ - test/app.config - test/AssemblyInfo.cs - test/Program.cs - test/Properties/ - test/Properties/Resources.Designer.cs - test/Properties/Resources.resx - test/test.2005.csproj - test/test.2008.csproj - test/test.2010.csproj - test/TestCases.cs - test/TestCasesDialog.cs - test/TestCasesDialog.Designer.cs - test/TestCasesDialog.resx - testce/ - testce/AssemblyInfo.cs - testce/Form1.cs - testce/Form1.Designer.cs - testce/Form1.resx - testce/Program.cs - testce/TestCases.cs - testce/testce.2005.csproj - testce/testce.2008.csproj - testlinq/ - testlinq/2008/ - testlinq/2008/App.config - testlinq/2010/ - testlinq/2010/App.config - testlinq/northwindEF.db - testlinq/NorthwindModel2008.Designer.cs - testlinq/NorthwindModel2008.edmx - testlinq/NorthwindModel2010.Designer.cs - testlinq/NorthwindModel2010.edmx - testlinq/Program.cs - testlinq/Properties/ - testlinq/Properties/AssemblyInfo.cs - testlinq/testlinq.2008.csproj - testlinq/testlinq.2010.csproj - Tests/ - Tests/all.eagle - Tests/backup.eagle - Tests/basic.eagle - Tests/common.eagle - Tests/installer.eagle - Tests/Installer_Test_Vs2005.log - Tests/Installer_Test_Vs2008.log - Tests/Installer_Test_Vs2010.log - Tests/nonWal.db - Tests/pkgIndex.eagle - Tests/testlinq.out - Tests/tkt-00f86f9739.eagle - Tests/tkt-0d5b1ef362.eagle - Tests/tkt-201128cc88.eagle - Tests/tkt-2c630bffa7.eagle - Tests/tkt-2ce0870fad.eagle - Tests/tkt-343d392b51.eagle - Tests/tkt-448d663d11.eagle - Tests/tkt-544dba0a2f.eagle - Tests/tkt-59edc1018b.eagle - Tests/tkt-72905c9a77.eagle - Tests/tkt-7e3fa93744.eagle - Tests/tkt-84718e79fa.eagle - Tests/tkt-8554170e09.eagle - Tests/tkt-8b7d179c3c.eagle - Tests/tkt-ac47dd230a.eagle - Tests/tkt-b4a7ddc83f.eagle - Tests/tkt-bb4b04d457.eagle - Tests/tkt-ccfa69fc32.eagle - Tests/tkt-e1b2e0f769.eagle - Tests/tkt-e30b820248.eagle - Tests/Uninstaller_Test_Vs2005.log - Tests/Uninstaller_Test_Vs2008.log - Tests/Uninstaller_Test_Vs2010.log - Tests/version.eagle - Tests/wal.db - tools/ - tools/install/ - tools/install/Installer.2005.csproj - tools/install/Installer.2008.csproj - tools/install/Installer.2010.csproj - tools/install/Installer.cs - tools/install/Properties/ - tools/install/Properties/AssemblyInfo.cs - tools/install/Resources/ - tools/install/Resources/manifest.xml -} - -############################################################################### -# -# NOTE: This is the list of all files that should be present in the standard -# binary archives (i.e. those not containing the mixed-mode assembly). -# -set sds_manifests(binary) { - Installer.exe - Installer.pdb - SQLite.Designer.dll - SQLite.Designer.pdb - SQLite.Designer.xml - SQLite.Interop.dll - SQLite.Interop.pdb - System.Data.SQLite.Linq.dll - System.Data.SQLite.Linq.pdb - System.Data.SQLite.Linq.xml - System.Data.SQLite.dll - System.Data.SQLite.pdb - System.Data.SQLite.xml - northwindEF.db - test.exe - test.exe.config - test.pdb - testlinq.exe - testlinq.exe.config - testlinq.pdb -} - -############################################################################### -# -# NOTE: This is the list of all files that should be present in the "bundle" -# binary archives (i.e. those not containing separate managed and native -# assemblies). -# -set sds_manifests(bundle) { - Installer.exe - Installer.pdb - SQLite.Designer.dll - SQLite.Designer.pdb - SQLite.Designer.xml - System.Data.SQLite.Linq.dll - System.Data.SQLite.Linq.pdb - System.Data.SQLite.Linq.xml - System.Data.SQLite.dll - System.Data.SQLite.pdb - System.Data.SQLite.xml - northwindEF.db - test.exe - test.exe.config - test.pdb - testlinq.exe - testlinq.exe.config - testlinq.pdb -} - -############################################################################### -# -# NOTE: This is the list of all files that should be present in the "PocketPC" -# binary archives (i.e. for the .NET Compact Framework). -# -set sds_manifests(compact) { - "SQLite.Interop.[format %03d $build].dll" - "SQLite.Interop.[format %03d $build].pdb" - System.Data.SQLite.dll - System.Data.SQLite.pdb - System.Data.SQLite.xml - testce.exe - testce.pdb -} - -############################################################################### -# -# NOTE: These are the master archive manifest groups, based on file name. The -# first element in each list is the array variable name prefix used to -# locate another array containing the named elements referenced by the -# remaining elements in each list. Here is an example: -# -# 1. First, the archive file name has the patch level removed from it. -# Next, it is mapped to the name of the array containing the file -# lists via the first element of the corresponding list. -# -# [lindex $manifests(EagleCore.exe) 0] ==> eagle ==> eagle_manifests -# -# 2. Next, the remaining elements are used to query the named file lists -# from the array discovered in the previous step. -# -# [lrange $manifests(EagleCore.exe) 1 end] ==> core library -# -# 3. Finally, the final list of files for this archive file name is built -# by combining all the file names in the file lists discovered in the -# previous step. Duplicate file names, if any, should be harmless. -# -# $result == $eagle_manifests(core) UNION $eagle_manifests(library) -# -############################################################################### - -set manifests(sqlite-netFx-source-.zip) [list sds source] - -############################################################################### - -set manifests(sqlite-netFx35-binary-Win32-2008-.zip) [list sds binary] -set manifests(sqlite-netFx35-binary-x64-2008-.zip) [list sds binary] -set manifests(sqlite-netFx35-binary-bundle-Win32-2008-.zip) [list sds bundle] -set manifests(sqlite-netFx35-binary-bundle-x64-2008-.zip) [list sds bundle] -set manifests(sqlite-netFx35-static-binary-Win32-2008-.zip) [list sds binary] -set manifests(sqlite-netFx35-static-binary-x64-2008-.zip) [list sds binary] -set manifests(sqlite-netFx35-static-binary-bundle-Win32-2008-.zip) [list sds bundle] -set manifests(sqlite-netFx35-static-binary-bundle-x64-2008-.zip) [list sds bundle] -set manifests(sqlite-netFx35-binary-PocketPC-2008-.zip) [list sds compact] -set manifests(sqlite-netFx35-binary-PocketPC-2008-.zip,subst) ""; # dynamic -set manifests(sqlite-netFx40-binary-Win32-2010-.zip) [list sds binary] -set manifests(sqlite-netFx40-binary-x64-2010-.zip) [list sds binary] -set manifests(sqlite-netFx40-binary-bundle-Win32-2010-.zip) [list sds bundle] -set manifests(sqlite-netFx40-binary-bundle-x64-2010-.zip) [list sds bundle] -set manifests(sqlite-netFx40-static-binary-Win32-2010-.zip) [list sds binary] -set manifests(sqlite-netFx40-static-binary-x64-2010-.zip) [list sds binary] -set manifests(sqlite-netFx40-static-binary-bundle-Win32-2010-.zip) [list sds bundle] -set manifests(sqlite-netFx40-static-binary-bundle-x64-2010-.zip) [list sds bundle] - -############################################################################### -# end of file Index: Setup/vsSp.bat ================================================================== --- Setup/vsSp.bat +++ Setup/vsSp.bat @@ -9,11 +9,11 @@ :: Released to the public domain, use at your own risk! :: SETLOCAL -REM SET __ECHO=ECHO +REM SET _ECHO=ECHO IF NOT DEFINED _AECHO (SET _AECHO=REM) IF NOT DEFINED _CECHO (SET _CECHO=REM) IF NOT DEFINED _VECHO (SET _VECHO=REM) %_AECHO% Running %0 %* Index: System.Data.SQLite.Linq/AssemblyInfo.cs ================================================================== --- System.Data.SQLite.Linq/AssemblyInfo.cs +++ System.Data.SQLite.Linq/AssemblyInfo.cs @@ -42,7 +42,7 @@ // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.81.0")] -[assembly: AssemblyFileVersion("1.0.81.0")] +[assembly: AssemblyVersion("1.0.78.0")] +[assembly: AssemblyFileVersion("1.0.78.0")] Index: System.Data.SQLite.Linq/Properties/Resources.Designer.cs ================================================================== --- System.Data.SQLite.Linq/Properties/Resources.Designer.cs +++ System.Data.SQLite.Linq/Properties/Resources.Designer.cs @@ -44,11 +44,11 @@ /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Data.SQLite.Linq.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Data.SQLite.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } Index: System.Data.SQLite.Linq/Properties/Resources.resx ================================================================== --- System.Data.SQLite.Linq/Properties/Resources.resx +++ System.Data.SQLite.Linq/Properties/Resources.resx @@ -1,19 +1,19 @@ - @@ -116,69 +116,24 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - CREATE TEMP VIEW SCHEMACONSTRAINTCOLUMNS AS - SELECT CONSTRAINT_CATALOG, - NULL AS CONSTRAINT_SCHEMA, - CONSTRAINT_NAME, - TABLE_CATALOG, - NULL AS TABLE_SCHEMA, - TABLE_NAME, - COLUMN_NAME - FROM TEMP.SCHEMAINDEXCOLUMNS - UNION - SELECT CONSTRAINT_CATALOG, - NULL, - CONSTRAINT_NAME, - TABLE_CATALOG, - NULL, - TABLE_NAME, - FKEY_FROM_COLUMN - FROM TEMP.SCHEMAFOREIGNKEYS; - + CREATE TEMP VIEW SCHEMACONSTRAINTCOLUMNS AS +SELECT CONSTRAINT_CATALOG, NULL AS CONSTRAINT_SCHEMA, CONSTRAINT_NAME, TABLE_CATALOG, NULL AS TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME +FROM TEMP.SCHEMAINDEXCOLUMNS +UNION +SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, FKEY_FROM_COLUMN +FROM TEMP.SCHEMAFOREIGNKEYS; - - CREATE TEMP VIEW SCHEMACONSTRAINTS AS - SELECT INDEX_CATALOG AS CONSTRAINT_CATALOG, - NULL AS CONSTRAINT_SCHEMA, - INDEX_NAME AS CONSTRAINT_NAME, - TABLE_CATALOG, - NULL AS TABLE_SCHEMA, - TABLE_NAME, - 'PRIMARY KEY' AS CONSTRAINT_TYPE, - 0 AS IS_DEFERRABLE, - 0 AS INITIALLY_DEFERRED, - NULL AS CHECK_CLAUSE - FROM TEMP.SCHEMAINDEXES - WHERE PRIMARY_KEY = 1 - UNION - SELECT INDEX_CATALOG, - NULL, - INDEX_NAME, - TABLE_CATALOG, - NULL, - TABLE_NAME, - 'UNIQUE', - 0, - 0, - NULL - FROM TEMP.SCHEMAINDEXES - WHERE PRIMARY_KEY = 0 AND [UNIQUE] = 1 - UNION - SELECT CONSTRAINT_CATALOG, - NULL, - CONSTRAINT_NAME, - TABLE_CATALOG, - NULL, - TABLE_NAME, - CONSTRAINT_TYPE, - IS_DEFERRABLE, - INITIALLY_DEFERRED, - NULL - FROM TEMP.SCHEMAFOREIGNKEYS; - + CREATE TEMP VIEW SCHEMACONSTRAINTS AS +SELECT INDEX_CATALOG AS CONSTRAINT_CATALOG, NULL AS CONSTRAINT_SCHEMA, INDEX_NAME AS CONSTRAINT_NAME, TABLE_CATALOG, NULL AS TABLE_SCHEMA, TABLE_NAME, 'PRIMARY KEY' AS CONSTRAINT_TYPE, 0 AS IS_DEFERRABLE, 0 AS INITIALLY_DEFERRED, NULL AS CHECK_CLAUSE +FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 1 +UNION +SELECT INDEX_CATALOG, NULL, INDEX_NAME, TABLE_CATALOG, NULL, TABLE_NAME, 'UNIQUE', 0, 0, NULL +FROM TEMP.SCHEMAINDEXES WHERE PRIMARY_KEY = 0 AND [UNIQUE] = 1 +UNION +SELECT CONSTRAINT_CATALOG, NULL, CONSTRAINT_NAME, TABLE_CATALOG, NULL, TABLE_NAME, CONSTRAINT_TYPE, IS_DEFERRABLE, INITIALLY_DEFERRED, NULL +FROM TEMP.SCHEMAFOREIGNKEYS; Index: System.Data.SQLite.Linq/SQL Generation/DmlSqlGenerator.cs ================================================================== --- System.Data.SQLite.Linq/SQL Generation/DmlSqlGenerator.cs +++ System.Data.SQLite.Linq/SQL Generation/DmlSqlGenerator.cs @@ -195,15 +195,11 @@ commandText.Append("FROM "); tree.Target.Expression.Accept(translator); commandText.AppendLine(); // where -#if INTEROP_EXTENSION_FUNCTIONS commandText.Append("WHERE last_rows_affected() > 0"); -#else - commandText.Append("WHERE changes() > 0"); -#endif EntitySetBase table = ((DbScanExpression)tree.Target.Expression).Target; bool identity = false; foreach (EdmMember keyMember in table.ElementType.KeyMembers) { commandText.Append(" AND "); Index: System.Data.SQLite.Linq/SQL Generation/SqlGenerator.cs ================================================================== --- System.Data.SQLite.Linq/SQL Generation/SqlGenerator.cs +++ System.Data.SQLite.Linq/SQL Generation/SqlGenerator.cs @@ -326,22 +326,17 @@ /// /// private static Dictionary InitializeCanonicalFunctionHandlers() { Dictionary functionHandlers = new Dictionary(16, StringComparer.Ordinal); - -#if INTEROP_EXTENSION_FUNCTIONS functionHandlers.Add("IndexOf", HandleCanonicalFunctionIndexOf); -#endif - functionHandlers.Add("Length", HandleCanonicalFunctionLength); functionHandlers.Add("NewGuid", HandleCanonicalFunctionNewGuid); functionHandlers.Add("Round", HandleCanonicalFunctionRound); functionHandlers.Add("ToLower", HandleCanonicalFunctionToLower); functionHandlers.Add("ToUpper", HandleCanonicalFunctionToUpper); functionHandlers.Add("Trim", HandleCanonicalFunctionTrim); - functionHandlers.Add("Left", HandleCanonicalFunctionLeft); functionHandlers.Add("Right", HandleCanonicalFunctionRight); functionHandlers.Add("CurrentDateTime", HandleGetDateFunction); functionHandlers.Add("CurrentUtcDateTime", HandleGetUtcDateFunction); //DatePartFunctions @@ -2863,11 +2858,10 @@ result.Append(") AS integer)"); return result; } -#if INTEROP_EXTENSION_FUNCTIONS /// /// Function rename IndexOf -> CHARINDEX /// /// /// @@ -2874,11 +2868,10 @@ /// private static ISqlFragment HandleCanonicalFunctionIndexOf(SqlGenerator sqlgen, DbFunctionExpression e) { return sqlgen.HandleFunctionDefaultGivenName(e, "CHARINDEX"); } -#endif /// /// Function rename NewGuid -> NEWID /// /// @@ -2950,31 +2943,10 @@ result.Append(")"); return result; } - /// - /// LEFT(string, length) -> SUBSTR(string, 1, length) - /// - /// - /// - /// - private static ISqlFragment HandleCanonicalFunctionLeft(SqlGenerator sqlgen, DbFunctionExpression e) - { - SqlBuilder result = new SqlBuilder(); - - result.Append("SUBSTR("); - - Debug.Assert(e.Arguments.Count == 2, "Left should have two arguments"); - result.Append(e.Arguments[0].Accept(sqlgen)); - result.Append(", 1, "); - result.Append(e.Arguments[1].Accept(sqlgen)); - result.Append(")"); - - return result; - } - /// /// RIGHT(string, length) -> SUBSTR(string, -(length), length) /// /// /// Index: System.Data.SQLite/AssemblyInfo.cs ================================================================== --- System.Data.SQLite/AssemblyInfo.cs +++ System.Data.SQLite/AssemblyInfo.cs @@ -62,9 +62,9 @@ // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.81.0")] +[assembly: AssemblyVersion("1.0.78.0")] #if !PLATFORM_COMPACTFRAMEWORK -[assembly: AssemblyFileVersion("1.0.81.0")] +[assembly: AssemblyFileVersion("1.0.78.0")] #endif Index: System.Data.SQLite/LINQ/SQLiteFactory_Linq.cs ================================================================== --- System.Data.SQLite/LINQ/SQLiteFactory_Linq.cs +++ System.Data.SQLite/LINQ/SQLiteFactory_Linq.cs @@ -19,14 +19,10 @@ private static Type _dbProviderServicesType; private static object _sqliteServices; static SQLiteFactory() { -#if (SQLITE_STANDARD || USE_INTEROP_DLL || PLATFORM_COMPACTFRAMEWORK) && PRELOAD_NATIVE_LIBRARY - UnsafeNativeMethods.Initialize(); -#endif - #if !PLATFORM_COMPACTFRAMEWORK SQLiteLog.Initialize(); #endif string version = Index: System.Data.SQLite/SQLite3.cs ================================================================== --- System.Data.SQLite/SQLite3.cs +++ System.Data.SQLite/SQLite3.cs @@ -6,16 +6,14 @@ ********************************************************/ namespace System.Data.SQLite { using System; - using System.Collections.Generic; #if DEBUG using System.Diagnostics; #endif using System.Runtime.InteropServices; - using System.Text; #if !PLATFORM_COMPACTFRAMEWORK [UnmanagedFunctionPointer(CallingConvention.Cdecl)] #endif internal delegate void SQLiteLogCallback(IntPtr puser, int err_code, IntPtr message); @@ -23,12 +21,10 @@ /// /// This class implements SQLiteBase completely, and is the guts of the code that interop's SQLite with .NET /// internal class SQLite3 : SQLiteBase { - private static object syncRoot = new object(); - // // NOTE: This is the public key for the System.Data.SQLite assembly. If you change the // SNK file, you will need to change this as well. // internal const string PublicKey = @@ -36,11 +32,11 @@ "b621ddff5d844727418956997f475eb829429e411aff3e93f97b70de698b972640925bdd44280df0" + "a25a843266973704137cbb0e7441c1fe7cae4e2440ae91ab8cde3933febcb1ac48dd33b40e13c421" + "d8215c18a4349a436dd499e3c385cc683015f886f6c10bd90115eb2bd61b67750839e3a19941dc9c"; #if !PLATFORM_COMPACTFRAMEWORK - internal const string DesignerVersion = "1.0.81.0"; + internal const string DesignerVersion = "1.0.78.0"; #endif /// /// The opaque pointer returned to us by the sqlite provider /// @@ -115,16 +111,12 @@ { if (_sql != null) { if (_usePool) { - SQLiteBase.ResetConnection(_sql, _sql); + SQLiteBase.ResetConnection(_sql); SQLiteConnectionPool.Add(_fileName, _sql, _poolVersion); - -#if DEBUG && !NET_COMPACT_20 - Trace.WriteLine(String.Format("Close (Pool): {0}", _sql)); -#endif } else { _sql.Dispose(); } @@ -145,35 +137,10 @@ { return SQLite3.SQLiteVersion; } } - internal static string DefineConstants - { - get - { - StringBuilder result = new StringBuilder(); - IList list = SQLiteDefineConstants.OptionList; - - if (list != null) - { - foreach (string element in list) - { - if (element == null) - continue; - - if (result.Length > 0) - result.Append(' '); - - result.Append(element); - } - } - - return result.ToString(); - } - } - internal static string SQLiteVersion { get { return UTF8ToString(UnsafeNativeMethods.sqlite3_libversion(), -1); @@ -190,11 +157,11 @@ internal override bool AutoCommit { get { - return IsAutocommit(_sql, _sql); + return IsAutocommit(_sql); } } internal override long LastInsertRowId { @@ -242,75 +209,54 @@ internal override bool IsOpen() { return (_sql != null); } - internal override void Open(string strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, int maxPoolSize, bool usePool) + internal override void Open(string strFilename, SQLiteOpenFlagsEnum flags, int maxPoolSize, bool usePool) { if (_sql != null) return; _usePool = usePool; - _fileName = strFilename; - if (usePool) { + _fileName = strFilename; _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion); - -#if DEBUG && !NET_COMPACT_20 - Trace.WriteLine(String.Format("Open (Pool): {0}", (_sql != null) ? _sql.ToString() : "")); -#endif } if (_sql == null) { IntPtr db; #if !SQLITE_STANDARD - int n = UnsafeNativeMethods.sqlite3_open_interop(ToUTF8(strFilename), (int)openFlags, out db); + int n = UnsafeNativeMethods.sqlite3_open_interop(ToUTF8(strFilename), (int)flags, out db); #else - int n = UnsafeNativeMethods.sqlite3_open_v2(ToUTF8(strFilename), out db, (int)openFlags, IntPtr.Zero); + int n = UnsafeNativeMethods.sqlite3_open_v2(ToUTF8(strFilename), out db, (int)flags, IntPtr.Zero); #endif -#if DEBUG && !NET_COMPACT_20 +#if DEBUG Trace.WriteLine(String.Format("Open: {0}", db)); #endif if (n > 0) throw new SQLiteException(n, null); - _sql = new SQLiteConnectionHandle(db); - lock (_sql) { /* HACK: Force the SyncBlock to be "created" now. */ } + _sql = db; } // Bind functions to this connection. If any previous functions of the same name // were already bound, then the new bindings replace the old. - _functionsArray = SQLiteFunction.BindFunctions(this, connectionFlags); + _functionsArray = SQLiteFunction.BindFunctions(this); SetTimeout(0); - GC.KeepAlive(_sql); } internal override void ClearPool() { SQLiteConnectionPool.ClearPool(_fileName); } - internal override int CountPool() - { - Dictionary counts = null; - int openCount = 0; - int closeCount = 0; - int totalCount = 0; - - SQLiteConnectionPool.GetCounts(_fileName, - ref counts, ref openCount, ref closeCount, - ref totalCount); - - return totalCount; - } - internal override void SetTimeout(int nTimeoutMS) { int n = UnsafeNativeMethods.sqlite3_busy_timeout(_sql, nTimeoutMS); - if (n > 0) throw new SQLiteException(n, GetLastError()); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override bool Step(SQLiteStatement stmt) { int n; @@ -333,11 +279,11 @@ // schema has changed, re-try the step again. If it errored our because the database // is locked, then keep retrying until the command timeout occurs. r = Reset(stmt); if (r == 0) - throw new SQLiteException(n, GetLastError()); + throw new SQLiteException(n, SQLiteLastError()); else if ((r == 6 || r == 5) && stmt._command != null) // SQLITE_LOCKED || SQLITE_BUSY { // Keep trying if (rnd == null) // First time we've encountered the lock @@ -344,11 +290,11 @@ rnd = new Random(); // If we've exceeded the command's timeout, give up and throw an error if ((uint)Environment.TickCount - starttick > timeout) { - throw new SQLiteException(r, GetLastError()); + throw new SQLiteException(r, SQLiteLastError()); } else { // Otherwise sleep for a random amount of time up to 150ms System.Threading.Thread.Sleep(rnd.Next(1, 150)); @@ -388,18 +334,18 @@ } else if (n == 6 || n == 5) // SQLITE_LOCKED || SQLITE_BUSY return n; if (n > 0) - throw new SQLiteException(n, GetLastError()); + throw new SQLiteException(n, SQLiteLastError()); return 0; // We reset OK, no schema changes } - internal override string GetLastError() + internal override string SQLiteLastError() { - return SQLiteBase.GetLastError(_sql, _sql); + return SQLiteBase.SQLiteLastError(_sql); } internal override SQLiteStatement Prepare(SQLiteConnection cnn, string strSql, SQLiteStatement previous, uint timeoutMS, out string strRemain) { if (!String.IsNullOrEmpty(strSql)) @@ -420,22 +366,15 @@ strSql = strSql.Replace( String.Format("{0}.", baseSchemaName), String.Empty); } } - SQLiteConnectionFlags flags = - (cnn != null) ? cnn.Flags : SQLiteConnectionFlags.Default; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogPrepare) == SQLiteConnectionFlags.LogPrepare) - { - if ((strSql == null) || (strSql.Length == 0) || (strSql.Trim().Length == 0)) - SQLiteLog.LogMessage(0, "Preparing {}..."); - else - SQLiteLog.LogMessage(0, String.Format("Preparing {{{0}}}...", strSql)); - } -#endif + if ((cnn != null) && + ((cnn.Flags & SQLiteConnectionFlags.LogPrepare) == SQLiteConnectionFlags.LogPrepare)) + { + LogMessage(0, String.Format("Preparing {{{0}}}...", strSql)); + } IntPtr stmt = IntPtr.Zero; IntPtr ptr = IntPtr.Zero; int len = 0; int n = 17; @@ -457,19 +396,19 @@ #else n = UnsafeNativeMethods.sqlite3_prepare(_sql, psql, b.Length - 1, out stmt, out ptr); len = -1; #endif -#if DEBUG && !NET_COMPACT_20 +#if DEBUG Trace.WriteLine(String.Format("Prepare: {0}", stmt)); #endif if (n == 17) retries++; else if (n == 1) { - if (String.Compare(GetLastError(), "near \"TYPES\": syntax error", StringComparison.OrdinalIgnoreCase) == 0) + if (String.Compare(SQLiteLastError(), "near \"TYPES\": syntax error", StringComparison.OrdinalIgnoreCase) == 0) { int pos = strSql.IndexOf(';'); if (pos == -1) pos = strSql.Length - 1; typedefs = strSql.Substring(0, pos + 1); @@ -487,11 +426,11 @@ cmd.SetTypes(typedefs); return cmd; } #if !PLATFORM_COMPACTFRAMEWORK - else if (_buildingSchema == false && String.Compare(GetLastError(), 0, "no such table: TEMP.SCHEMA", 0, 26, StringComparison.OrdinalIgnoreCase) == 0) + else if (_buildingSchema == false && String.Compare(SQLiteLastError(), 0, "no such table: TEMP.SCHEMA", 0, 26, StringComparison.OrdinalIgnoreCase) == 0) { strRemain = ""; _buildingSchema = true; try { @@ -522,390 +461,163 @@ rnd = new Random(); // If we've exceeded the command's timeout, give up and throw an error if ((uint)Environment.TickCount - starttick > timeoutMS) { - throw new SQLiteException(n, GetLastError()); + throw new SQLiteException(n, SQLiteLastError()); } else { // Otherwise sleep for a random amount of time up to 150ms System.Threading.Thread.Sleep(rnd.Next(1, 150)); } } } - if (n > 0) throw new SQLiteException(n, GetLastError()); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); strRemain = UTF8ToString(ptr, len); - if (stmt != IntPtr.Zero) cmd = new SQLiteStatement(this, flags, new SQLiteStatementHandle(_sql, stmt), strSql.Substring(0, strSql.Length - strRemain.Length), previous); + if (stmt != IntPtr.Zero) cmd = new SQLiteStatement(this, stmt, strSql.Substring(0, strSql.Length - strRemain.Length), previous); return cmd; } finally { handle.Free(); } } -#if !PLATFORM_COMPACTFRAMEWORK - protected static void LogBind(SQLiteStatementHandle handle, int index) - { - IntPtr handleIntPtr = handle; - - SQLiteLog.LogMessage(0, String.Format( - "Binding statement {0} paramter #{1} as NULL...", - handleIntPtr, index)); - } - - protected static void LogBind(SQLiteStatementHandle handle, int index, ValueType value) - { - IntPtr handleIntPtr = handle; - - SQLiteLog.LogMessage(0, String.Format( - "Binding statement {0} paramter #{1} as type {2} with value {{{3}}}...", - handleIntPtr, index, value.GetType(), value)); - } - - private static string FormatDateTime(DateTime value) - { - StringBuilder result = new StringBuilder(); - - result.Append(value.ToString("yyyy-MM-ddTHH:mm:ss.FFFFFFFK")); - result.Append(' '); - result.Append(value.Kind); - result.Append(' '); - result.Append(value.Ticks); - - return result.ToString(); - } - - protected static void LogBind(SQLiteStatementHandle handle, int index, DateTime value) - { - IntPtr handleIntPtr = handle; - - SQLiteLog.LogMessage(0, String.Format( - "Binding statement {0} paramter #{1} as type {2} with value {{{3}}}...", - handleIntPtr, index, typeof(DateTime), FormatDateTime(value))); - } - - protected static void LogBind(SQLiteStatementHandle handle, int index, string value) - { - IntPtr handleIntPtr = handle; - - SQLiteLog.LogMessage(0, String.Format( - "Binding statement {0} paramter #{1} as type {2} with value {{{3}}}...", - handleIntPtr, index, typeof(String), (value != null) ? value : "")); - } - - private static string ToHexadecimalString( - byte[] array - ) - { - if (array == null) - return null; - - StringBuilder result = new StringBuilder(array.Length * 2); - - int length = array.Length; - - for (int index = 0; index < length; index++) - result.Append(array[index].ToString("x2")); - - return result.ToString(); - } - - protected static void LogBind(SQLiteStatementHandle handle, int index, byte[] value) - { - IntPtr handleIntPtr = handle; - - SQLiteLog.LogMessage(0, String.Format( - "Binding statement {0} paramter #{1} as type {2} with value {{{3}}}...", - handleIntPtr, index, typeof(Byte[]), (value != null) ? ToHexadecimalString(value) : "")); - } -#endif - - internal override void Bind_Double(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, double value) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } - - int n = UnsafeNativeMethods.sqlite3_bind_double(handle, index, value); -#else - int n = UnsafeNativeMethods.sqlite3_bind_double_interop(handle, index, ref value); -#endif - if (n > 0) throw new SQLiteException(n, GetLastError()); - } - - internal override void Bind_Int32(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, int value) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } -#endif - - int n = UnsafeNativeMethods.sqlite3_bind_int(handle, index, value); - if (n > 0) throw new SQLiteException(n, GetLastError()); - } - - internal override void Bind_UInt32(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, uint value) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } -#endif - - int n = UnsafeNativeMethods.sqlite3_bind_uint(handle, index, value); - if (n > 0) throw new SQLiteException(n, GetLastError()); - } - - internal override void Bind_Int64(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, long value) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } - - int n = UnsafeNativeMethods.sqlite3_bind_int64(handle, index, value); -#else - int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(handle, index, ref value); -#endif - if (n > 0) throw new SQLiteException(n, GetLastError()); - } - - internal override void Bind_UInt64(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, ulong value) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } - - int n = UnsafeNativeMethods.sqlite3_bind_uint64(handle, index, value); -#else - int n = UnsafeNativeMethods.sqlite3_bind_uint64_interop(handle, index, ref value); -#endif - if (n > 0) throw new SQLiteException(n, GetLastError()); - } - - internal override void Bind_Text(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, string value) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } -#endif - - byte[] b = ToUTF8(value); - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, b); - } -#endif - - int n = UnsafeNativeMethods.sqlite3_bind_text(handle, index, b, b.Length - 1, (IntPtr)(-1)); - if (n > 0) throw new SQLiteException(n, GetLastError()); - } - - internal override void Bind_DateTime(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, DateTime dt) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, dt); - } -#endif - + internal override void Bind_Double(SQLiteStatement stmt, int index, double value) + { +#if !PLATFORM_COMPACTFRAMEWORK + int n = UnsafeNativeMethods.sqlite3_bind_double(stmt._sqlite_stmt, index, value); +#else + int n = UnsafeNativeMethods.sqlite3_bind_double_interop(stmt._sqlite_stmt, index, ref value); +#endif + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + } + + internal override void Bind_Int32(SQLiteStatement stmt, int index, int value) + { + int n = UnsafeNativeMethods.sqlite3_bind_int(stmt._sqlite_stmt, index, value); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + } + + internal override void Bind_UInt32(SQLiteStatement stmt, int index, uint value) + { + int n = UnsafeNativeMethods.sqlite3_bind_uint(stmt._sqlite_stmt, index, value); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + } + + internal override void Bind_Int64(SQLiteStatement stmt, int index, long value) + { +#if !PLATFORM_COMPACTFRAMEWORK + int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); +#else + int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); +#endif + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + } + + internal override void Bind_UInt64(SQLiteStatement stmt, int index, ulong value) + { +#if !PLATFORM_COMPACTFRAMEWORK + int n = UnsafeNativeMethods.sqlite3_bind_uint64(stmt._sqlite_stmt, index, value); +#else + int n = UnsafeNativeMethods.sqlite3_bind_uint64_interop(stmt._sqlite_stmt, index, ref value); +#endif + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + } + + internal override void Bind_Text(SQLiteStatement stmt, int index, string value) + { + byte[] b = ToUTF8(value); + int n = UnsafeNativeMethods.sqlite3_bind_text(stmt._sqlite_stmt, index, b, b.Length - 1, (IntPtr)(-1)); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + } + + internal override void Bind_DateTime(SQLiteStatement stmt, int index, DateTime dt) + { switch (_datetimeFormat) { case SQLiteDateFormats.Ticks: { long value = dt.Ticks; #if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } - - int n = UnsafeNativeMethods.sqlite3_bind_int64(handle, index, value); + int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); #else - int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(handle, index, ref value); + int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); #endif - if (n > 0) throw new SQLiteException(n, GetLastError()); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); break; } case SQLiteDateFormats.JulianDay: { double value = ToJulianDay(dt); #if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } - - int n = UnsafeNativeMethods.sqlite3_bind_double(handle, index, value); + int n = UnsafeNativeMethods.sqlite3_bind_double(stmt._sqlite_stmt, index, value); #else - int n = UnsafeNativeMethods.sqlite3_bind_double_interop(handle, index, ref value); + int n = UnsafeNativeMethods.sqlite3_bind_double_interop(stmt._sqlite_stmt, index, ref value); #endif - if (n > 0) throw new SQLiteException(n, GetLastError()); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); break; } case SQLiteDateFormats.UnixEpoch: { long value = Convert.ToInt64(dt.Subtract(UnixEpoch).TotalSeconds); #if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } - - int n = UnsafeNativeMethods.sqlite3_bind_int64(handle, index, value); -#else - int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(handle, index, ref value); -#endif - if (n > 0) throw new SQLiteException(n, GetLastError()); - break; - } - default: - { - byte[] b = ToUTF8(dt); - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, b); - } -#endif - - int n = UnsafeNativeMethods.sqlite3_bind_text(handle, index, b, b.Length - 1, (IntPtr)(-1)); - if (n > 0) throw new SQLiteException(n, GetLastError()); - break; - } - } - } - - internal override void Bind_Blob(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, byte[] blobData) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, blobData); - } -#endif - - int n = UnsafeNativeMethods.sqlite3_bind_blob(handle, index, blobData, blobData.Length, (IntPtr)(-1)); - if (n > 0) throw new SQLiteException(n, GetLastError()); - } - - internal override void Bind_Null(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index); - } -#endif - - int n = UnsafeNativeMethods.sqlite3_bind_null(handle, index); - if (n > 0) throw new SQLiteException(n, GetLastError()); - } - - internal override int Bind_ParamCount(SQLiteStatement stmt, SQLiteConnectionFlags flags) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - int value = UnsafeNativeMethods.sqlite3_bind_parameter_count(handle); - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - IntPtr handleIntPtr = handle; - - SQLiteLog.LogMessage(0, String.Format( - "Statement {0} paramter count is {1}.", - handleIntPtr, value)); - } -#endif - - return value; - } - - internal override string Bind_ParamName(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - string name; - -#if !SQLITE_STANDARD - int len; - name = UTF8ToString(UnsafeNativeMethods.sqlite3_bind_parameter_name_interop(handle, index, out len), len); -#else - name = UTF8ToString(UnsafeNativeMethods.sqlite3_bind_parameter_name(handle, index), -1); -#endif - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - IntPtr handleIntPtr = handle; - - SQLiteLog.LogMessage(0, String.Format( - "Statement {0} paramter #{1} name is {{{2}}}.", - handleIntPtr, index, name)); - } -#endif - - return name; - } - - internal override int Bind_ParamIndex(SQLiteStatement stmt, SQLiteConnectionFlags flags, string paramName) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - int index = UnsafeNativeMethods.sqlite3_bind_parameter_index(handle, ToUTF8(paramName)); - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - IntPtr handleIntPtr = handle; - - SQLiteLog.LogMessage(0, String.Format( - "Statement {0} paramter index of name {{{1}}} is #{2}.", - handleIntPtr, paramName, index)); - } -#endif - - return index; + int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); +#else + int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); +#endif + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + break; + } + default: + { + byte[] b = ToUTF8(dt); + int n = UnsafeNativeMethods.sqlite3_bind_text(stmt._sqlite_stmt, index, b, b.Length - 1, (IntPtr)(-1)); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + break; + } + } + } + + internal override void Bind_Blob(SQLiteStatement stmt, int index, byte[] blobData) + { + int n = UnsafeNativeMethods.sqlite3_bind_blob(stmt._sqlite_stmt, index, blobData, blobData.Length, (IntPtr)(-1)); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + } + + internal override void Bind_Null(SQLiteStatement stmt, int index) + { + int n = UnsafeNativeMethods.sqlite3_bind_null(stmt._sqlite_stmt, index); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + } + + internal override int Bind_ParamCount(SQLiteStatement stmt) + { + return UnsafeNativeMethods.sqlite3_bind_parameter_count(stmt._sqlite_stmt); + } + + internal override string Bind_ParamName(SQLiteStatement stmt, int index) + { +#if !SQLITE_STANDARD + int len; + return UTF8ToString(UnsafeNativeMethods.sqlite3_bind_parameter_name_interop(stmt._sqlite_stmt, index, out len), len); +#else + return UTF8ToString(UnsafeNativeMethods.sqlite3_bind_parameter_name(stmt._sqlite_stmt, index), -1); +#endif + } + + internal override int Bind_ParamIndex(SQLiteStatement stmt, string paramName) + { + return UnsafeNativeMethods.sqlite3_bind_parameter_index(stmt._sqlite_stmt, ToUTF8(paramName)); } internal override int ColumnCount(SQLiteStatement stmt) { return UnsafeNativeMethods.sqlite3_column_count(stmt._sqlite_stmt); @@ -1021,11 +733,11 @@ dtLen = -1; csLen = -1; n = UnsafeNativeMethods.sqlite3_table_column_metadata(_sql, ToUTF8(dataBase), ToUTF8(table), ToUTF8(column), out dataTypePtr, out collSeqPtr, out nnotNull, out nprimaryKey, out nautoInc); #endif - if (n > 0) throw new SQLiteException(n, GetLastError()); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); dataType = UTF8ToString(dataTypePtr, dtLen); collateSequence = UTF8ToString(collSeqPtr, csLen); notNull = (nnotNull == 1); @@ -1145,18 +857,18 @@ if (n == 0) n = UnsafeNativeMethods.sqlite3_create_function_interop(_sql, ToUTF8(strFunction), nArgs, 1, IntPtr.Zero, func, funcstep, funcfinal, (needCollSeq == true) ? 1 : 0); #else n = UnsafeNativeMethods.sqlite3_create_function(_sql, ToUTF8(strFunction), nArgs, 4, IntPtr.Zero, func, funcstep, funcfinal); if (n == 0) n = UnsafeNativeMethods.sqlite3_create_function(_sql, ToUTF8(strFunction), nArgs, 1, IntPtr.Zero, func, funcstep, funcfinal); #endif - if (n > 0) throw new SQLiteException(n, GetLastError()); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16) { int n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 2, IntPtr.Zero, func16); if (n == 0) n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 1, IntPtr.Zero, func); - if (n > 0) throw new SQLiteException(n, GetLastError()); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override int ContextCollateCompare(CollationEncodingEnum enc, IntPtr context, string s1, string s2) { #if !SQLITE_STANDARD @@ -1372,23 +1084,21 @@ internal override void LogMessage(int iErrCode, string zMessage) { UnsafeNativeMethods.sqlite3_log(iErrCode, ToUTF8(zMessage)); } -#if INTEROP_CODEC internal override void SetPassword(byte[] passwordBytes) { int n = UnsafeNativeMethods.sqlite3_key(_sql, passwordBytes, passwordBytes.Length); - if (n > 0) throw new SQLiteException(n, GetLastError()); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } internal override void ChangePassword(byte[] newPasswordBytes) { int n = UnsafeNativeMethods.sqlite3_rekey(_sql, newPasswordBytes, (newPasswordBytes == null) ? 0 : newPasswordBytes.Length); - if (n > 0) throw new SQLiteException(n, GetLastError()); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); } -#endif internal override void SetUpdateHook(SQLiteUpdateCallback func) { UnsafeNativeMethods.sqlite3_update_hook(_sql, func, IntPtr.Zero); } @@ -1421,202 +1131,10 @@ (int)SQLiteConfigOpsEnum.SQLITE_CONFIG_LOG, func, (IntPtr)0); return rc; } - /////////////////////////////////////////////////////////////////////////////////////////////// - - /// - /// Creates a new SQLite backup object based on the provided destination - /// database connection. The source database connection is the one - /// associated with this object. The source and destination database - /// connections cannot be the same. - /// - /// The destination database connection. - /// The destination database name. - /// The source database name. - /// The newly created backup object. - internal override SQLiteBackup InitializeBackup( - SQLiteConnection destCnn, - string destName, - string sourceName - ) - { - if (destCnn == null) - throw new ArgumentNullException("destCnn"); - - if (destName == null) - throw new ArgumentNullException("destName"); - - if (sourceName == null) - throw new ArgumentNullException("sourceName"); - - SQLite3 destSqlite3 = destCnn._sql as SQLite3; - - if (destSqlite3 == null) - throw new ArgumentException( - "Destination connection has no wrapper.", - "destCnn"); - - SQLiteConnectionHandle destHandle = destSqlite3._sql; - - if (destHandle == null) - throw new ArgumentException( - "Destination connection has an invalid handle.", - "destCnn"); - - SQLiteConnectionHandle sourceHandle = _sql; - - if (sourceHandle == null) - throw new InvalidOperationException( - "Source connection has an invalid handle."); - - byte[] zDestName = ToUTF8(destName); - byte[] zSourceName = ToUTF8(sourceName); - - IntPtr backup = UnsafeNativeMethods.sqlite3_backup_init( - destHandle, zDestName, sourceHandle, zSourceName); - - if (backup == IntPtr.Zero) - throw new SQLiteException(ResultCode(), GetLastError()); - - return new SQLiteBackup( - this, new SQLiteBackupHandle(destHandle, backup), - destHandle, zDestName, sourceHandle, zSourceName); - } - - /// - /// Copies up to N pages from the source database to the destination - /// database associated with the specified backup object. - /// - /// The backup object to use. - /// - /// The number of pages to copy, negative to copy all remaining pages. - /// - /// - /// Set to true if the operation needs to be retried due to database - /// locking issues; otherwise, set to false. - /// - /// - /// True if there are more pages to be copied, false otherwise. - /// - internal override bool StepBackup( - SQLiteBackup backup, - int nPage, - out bool retry - ) - { - retry = false; - - if (backup == null) - throw new ArgumentNullException("backup"); - - SQLiteBackupHandle handle = backup._sqlite_backup; - - if (handle == null) - throw new InvalidOperationException( - "Backup object has an invalid handle."); - - int n = UnsafeNativeMethods.sqlite3_backup_step(handle, nPage); - backup._stepResult = n; /* NOTE: Save for use by FinishBackup. */ - - if (n == (int)SQLiteErrorCode.Ok) - { - return true; - } - else if (n == (int)SQLiteErrorCode.Busy) - { - retry = true; - return true; - } - else if (n == (int)SQLiteErrorCode.Locked) - { - retry = true; - return true; - } - else if (n == (int)SQLiteErrorCode.Done) - { - return false; - } - else - { - throw new SQLiteException(n, GetLastError()); - } - } - - /// - /// Returns the number of pages remaining to be copied from the source - /// database to the destination database associated with the specified - /// backup object. - /// - /// The backup object to check. - /// The number of pages remaining to be copied. - internal override int RemainingBackup( - SQLiteBackup backup - ) - { - if (backup == null) - throw new ArgumentNullException("backup"); - - SQLiteBackupHandle handle = backup._sqlite_backup; - - if (handle == null) - throw new InvalidOperationException( - "Backup object has an invalid handle."); - - return UnsafeNativeMethods.sqlite3_backup_remaining(handle); - } - - /// - /// Returns the total number of pages in the source database associated - /// with the specified backup object. - /// - /// The backup object to check. - /// The total number of pages in the source database. - internal override int PageCountBackup( - SQLiteBackup backup - ) - { - if (backup == null) - throw new ArgumentNullException("backup"); - - SQLiteBackupHandle handle = backup._sqlite_backup; - - if (handle == null) - throw new InvalidOperationException( - "Backup object has an invalid handle."); - - return UnsafeNativeMethods.sqlite3_backup_pagecount(handle); - } - - /// - /// Destroys the backup object, rolling back any backup that may be in - /// progess. - /// - /// The backup object to destroy. - internal override void FinishBackup( - SQLiteBackup backup - ) - { - if (backup == null) - throw new ArgumentNullException("backup"); - - SQLiteBackupHandle handle = backup._sqlite_backup; - - if (handle == null) - throw new InvalidOperationException( - "Backup object has an invalid handle."); - - int n = UnsafeNativeMethods.sqlite3_backup_finish(handle); - handle.SetHandleAsInvalid(); - - if ((n > 0) && (n != backup._stepResult)) - throw new SQLiteException(n, GetLastError()); - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - /// /// Determines if the SQLite core library has been initialized for the /// current process. /// /// @@ -1637,43 +1155,32 @@ /// initialized for the current process. /// internal static bool StaticIsInitialized() { // - // BUGFIX: Prevent races with other threads for this entire block, due - // to the try/finally semantics. See ticket [72905c9a77]. - // - lock (syncRoot) - { -#if !PLATFORM_COMPACTFRAMEWORK - // - // NOTE: Save the state of the logging class and then restore it - // after we are done to avoid logging too many false errors. - // - bool savedEnabled = SQLiteLog.Enabled; - SQLiteLog.Enabled = false; - - try - { -#endif - // - // NOTE: This method [ab]uses the fact that SQLite will always - // return SQLITE_ERROR for any unknown configuration option - // *unless* the SQLite library has already been initialized. - // In that case it will always return SQLITE_MISUSE. - // - int rc = UnsafeNativeMethods.sqlite3_config( - (int)SQLiteConfigOpsEnum.SQLITE_CONFIG_NONE, null, (IntPtr)0); - - return (rc == /* SQLITE_MISUSE */ 21); -#if !PLATFORM_COMPACTFRAMEWORK - } - finally - { - SQLiteLog.Enabled = savedEnabled; - } -#endif + // NOTE: Save the state of the logging class and then restore it + // after we are done to avoid logging too many false errors. + // + bool savedEnabled = SQLiteLog.Enabled; + SQLiteLog.Enabled = false; + + try + { + // + // NOTE: This method [ab]uses the fact that SQLite will always + // return SQLITE_ERROR for any unknown configuration option + // *unless* the SQLite library has already been initialized. + // In that case it will always return SQLITE_MISUSE. + // + int rc = UnsafeNativeMethods.sqlite3_config( + (int)SQLiteConfigOpsEnum.SQLITE_CONFIG_NONE, null, (IntPtr)0); + + return (rc == /* SQLITE_MISUSE */ 21); + } + finally + { + SQLiteLog.Enabled = savedEnabled; } } /// /// Helper function to retrieve a column of data from an active statement. Index: System.Data.SQLite/SQLite3_UTF16.cs ================================================================== --- System.Data.SQLite/SQLite3_UTF16.cs +++ System.Data.SQLite/SQLite3_UTF16.cs @@ -6,76 +6,76 @@ ********************************************************/ namespace System.Data.SQLite { using System; -#if DEBUG +#if DEBUG using System.Diagnostics; #endif using System.Runtime.InteropServices; /// /// Alternate SQLite3 object, overriding many text behaviors to support UTF-16 (Unicode) /// internal class SQLite3_UTF16 : SQLite3 { - internal SQLite3_UTF16(SQLiteDateFormats fmt, DateTimeKind kind) - : base(fmt, kind) - { - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - #region IDisposable "Pattern" Members - private bool disposed; - private void CheckDisposed() /* throw */ - { -#if THROW_ON_DISPOSED - if (disposed) - throw new ObjectDisposedException(typeof(SQLite3_UTF16).Name); -#endif - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - protected override void Dispose(bool disposing) - { - try - { - if (!disposed) - { - //if (disposing) - //{ - // //////////////////////////////////// - // // dispose managed resources here... - // //////////////////////////////////// - //} - - ////////////////////////////////////// - // release unmanaged resources here... - ////////////////////////////////////// - - disposed = true; - } - } - finally - { - base.Dispose(disposing); - } - } - #endregion - - /////////////////////////////////////////////////////////////////////////////////////////////// - + internal SQLite3_UTF16(SQLiteDateFormats fmt, DateTimeKind kind) + : base(fmt, kind) + { + } + + /////////////////////////////////////////////////////////////////////////////////////////////// + + #region IDisposable "Pattern" Members + private bool disposed; + private void CheckDisposed() /* throw */ + { +#if THROW_ON_DISPOSED + if (disposed) + throw new ObjectDisposedException(typeof(SQLite3_UTF16).Name); +#endif + } + + /////////////////////////////////////////////////////////////////////////////////////////////// + + protected override void Dispose(bool disposing) + { + try + { + if (!disposed) + { + //if (disposing) + //{ + // //////////////////////////////////// + // // dispose managed resources here... + // //////////////////////////////////// + //} + + ////////////////////////////////////// + // release unmanaged resources here... + ////////////////////////////////////// + + disposed = true; + } + } + finally + { + base.Dispose(disposing); + } + } + #endregion + + /////////////////////////////////////////////////////////////////////////////////////////////// + /// /// Overrides SQLiteConvert.ToString() to marshal UTF-16 strings instead of UTF-8 /// /// A pointer to a UTF-16 string /// The length (IN BYTES) of the string /// A .NET string public override string ToString(IntPtr b, int nbytelen) - { + { CheckDisposed(); return UTF16ToString(b, nbytelen); } public static string UTF16ToString(IntPtr b, int nbytelen) @@ -86,168 +86,170 @@ return Marshal.PtrToStringUni(b); else return Marshal.PtrToStringUni(b, nbytelen / 2); } - internal override void Open(string strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, int maxPoolSize, bool usePool) - { + internal override void Open(string strFilename, SQLiteOpenFlagsEnum flags, int maxPoolSize, bool usePool) + { if (_sql != null) return; _usePool = usePool; - _fileName = strFilename; - if (usePool) { + _fileName = strFilename; _sql = SQLiteConnectionPool.Remove(strFilename, maxPoolSize, out _poolVersion); - -#if DEBUG && !NET_COMPACT_20 - Trace.WriteLine(String.Format("Open (Pool): {0}", (_sql != null) ? _sql.ToString() : "")); -#endif } if (_sql == null) { IntPtr db; #if !SQLITE_STANDARD - int n = UnsafeNativeMethods.sqlite3_open16_interop(ToUTF8(strFilename), (int)openFlags, out db); + int n = UnsafeNativeMethods.sqlite3_open16_interop(ToUTF8(strFilename), (int)flags, out db); #else - if ((openFlags & SQLiteOpenFlagsEnum.Create) == 0 && System.IO.File.Exists(strFilename) == false) + if ((flags & SQLiteOpenFlagsEnum.Create) == 0 && System.IO.File.Exists(strFilename) == false) throw new SQLiteException((int)SQLiteErrorCode.CantOpen, strFilename); int n = UnsafeNativeMethods.sqlite3_open16(strFilename, out db); -#endif - -#if DEBUG && !NET_COMPACT_20 - Trace.WriteLine(String.Format("Open: {0}", db)); -#endif - - if (n > 0) throw new SQLiteException(n, null); - - _sql = new SQLiteConnectionHandle(db); - lock (_sql) { /* HACK: Force the SyncBlock to be "created" now. */ } - } - _functionsArray = SQLiteFunction.BindFunctions(this, connectionFlags); - SetTimeout(0); - GC.KeepAlive(_sql); - } - - internal override void Bind_DateTime(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, DateTime dt) - { - switch (_datetimeFormat) - { - case SQLiteDateFormats.Ticks: - case SQLiteDateFormats.JulianDay: - case SQLiteDateFormats.UnixEpoch: - { - base.Bind_DateTime(stmt, flags, index, dt); - break; - } - default: - { -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - SQLiteStatementHandle handle = - (stmt != null) ? stmt._sqlite_stmt : null; - - LogBind(handle, index, dt); - } -#endif - - Bind_Text(stmt, flags, index, ToString(dt)); - break; - } - } - } - - internal override void Bind_Text(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, string value) - { - SQLiteStatementHandle handle = stmt._sqlite_stmt; - -#if !PLATFORM_COMPACTFRAMEWORK - if ((flags & SQLiteConnectionFlags.LogBind) == SQLiteConnectionFlags.LogBind) - { - LogBind(handle, index, value); - } -#endif - - int n = UnsafeNativeMethods.sqlite3_bind_text16(handle, index, value, value.Length * 2, (IntPtr)(-1)); - if (n > 0) throw new SQLiteException(n, GetLastError()); - } - - internal override DateTime GetDateTime(SQLiteStatement stmt, int index) - { +#endif + +#if DEBUG + Trace.WriteLine(String.Format("Open: {0}", db)); +#endif + + if (n > 0) throw new SQLiteException(n, null); + + _sql = db; + } + _functionsArray = SQLiteFunction.BindFunctions(this); + } + + internal override void Bind_DateTime(SQLiteStatement stmt, int index, DateTime dt) + { + switch (_datetimeFormat) + { + case SQLiteDateFormats.Ticks: + { + long value = dt.Ticks; + +#if !PLATFORM_COMPACTFRAMEWORK + int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); +#else + int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); +#endif + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + break; + } + case SQLiteDateFormats.JulianDay: + { + double value = ToJulianDay(dt); + +#if !PLATFORM_COMPACTFRAMEWORK + int n = UnsafeNativeMethods.sqlite3_bind_double(stmt._sqlite_stmt, index, value); +#else + int n = UnsafeNativeMethods.sqlite3_bind_double_interop(stmt._sqlite_stmt, index, ref value); +#endif + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + break; + } + case SQLiteDateFormats.UnixEpoch: + { + long value = Convert.ToInt64(dt.Subtract(UnixEpoch).TotalSeconds); + +#if !PLATFORM_COMPACTFRAMEWORK + int n = UnsafeNativeMethods.sqlite3_bind_int64(stmt._sqlite_stmt, index, value); +#else + int n = UnsafeNativeMethods.sqlite3_bind_int64_interop(stmt._sqlite_stmt, index, ref value); +#endif + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + break; + } + default: + { + Bind_Text(stmt, index, ToString(dt)); + break; + } + } + } + + internal override void Bind_Text(SQLiteStatement stmt, int index, string value) + { + int n = UnsafeNativeMethods.sqlite3_bind_text16(stmt._sqlite_stmt, index, value, value.Length * 2, (IntPtr)(-1)); + if (n > 0) throw new SQLiteException(n, SQLiteLastError()); + } + + internal override DateTime GetDateTime(SQLiteStatement stmt, int index) + { return ToDateTime(GetText(stmt, index)); } internal override string ColumnName(SQLiteStatement stmt, int index) - { + { #if !SQLITE_STANDARD int len; return UTF16ToString(UnsafeNativeMethods.sqlite3_column_name16_interop(stmt._sqlite_stmt, index, out len), len); #else return UTF16ToString(UnsafeNativeMethods.sqlite3_column_name16(stmt._sqlite_stmt, index), -1); #endif } internal override string GetText(SQLiteStatement stmt, int index) - { + { #if !SQLITE_STANDARD int len; return UTF16ToString(UnsafeNativeMethods.sqlite3_column_text16_interop(stmt._sqlite_stmt, index, out len), len); #else return UTF16ToString(UnsafeNativeMethods.sqlite3_column_text16(stmt._sqlite_stmt, index), -1); #endif } internal override string ColumnOriginalName(SQLiteStatement stmt, int index) - { + { #if !SQLITE_STANDARD int len; return UTF16ToString(UnsafeNativeMethods.sqlite3_column_origin_name16_interop(stmt._sqlite_stmt, index, out len), len); #else return UTF16ToString(UnsafeNativeMethods.sqlite3_column_origin_name16(stmt._sqlite_stmt, index), -1); #endif } internal override string ColumnDatabaseName(SQLiteStatement stmt, int index) - { + { #if !SQLITE_STANDARD int len; return UTF16ToString(UnsafeNativeMethods.sqlite3_column_database_name16_interop(stmt._sqlite_stmt, index, out len), len); #else return UTF16ToString(UnsafeNativeMethods.sqlite3_column_database_name16(stmt._sqlite_stmt, index), -1); #endif } internal override string ColumnTableName(SQLiteStatement stmt, int index) - { + { #if !SQLITE_STANDARD int len; return UTF16ToString(UnsafeNativeMethods.sqlite3_column_table_name16_interop(stmt._sqlite_stmt, index, out len), len); #else return UTF16ToString(UnsafeNativeMethods.sqlite3_column_table_name16(stmt._sqlite_stmt, index), -1); #endif } internal override string GetParamValueText(IntPtr ptr) - { + { #if !SQLITE_STANDARD int len; return UTF16ToString(UnsafeNativeMethods.sqlite3_value_text16_interop(ptr, out len), len); #else return UTF16ToString(UnsafeNativeMethods.sqlite3_value_text16(ptr), -1); #endif } internal override void ReturnError(IntPtr context, string value) - { + { UnsafeNativeMethods.sqlite3_result_error16(context, value, value.Length * 2); } - internal override void ReturnText(IntPtr context, string value) - { + internal override void ReturnText(IntPtr context, string value) + { UnsafeNativeMethods.sqlite3_result_text16(context, value, value.Length * 2, (IntPtr)(-1)); } } } DELETED System.Data.SQLite/SQLiteBackup.cs Index: System.Data.SQLite/SQLiteBackup.cs ================================================================== --- System.Data.SQLite/SQLiteBackup.cs +++ /dev/null @@ -1,149 +0,0 @@ -/******************************************************** - * ADO.NET 2.0 Data Provider for SQLite Version 3.X - * Written by Robert Simpson (robert@blackcastlesoft.com) - * - * Released to the public domain, use at your own risk! - ********************************************************/ - -namespace System.Data.SQLite -{ - using System; - - /// - /// Represents a single SQL backup in SQLite. - /// - internal sealed class SQLiteBackup : IDisposable - { - /// - /// The underlying SQLite object this backup is bound to. - /// - internal SQLiteBase _sql; - - /// - /// The actual backup handle. - /// - internal SQLiteBackupHandle _sqlite_backup; - - /// - /// The destination database for the backup. - /// - internal IntPtr _destDb; - - /// - /// The destination database name for the backup. - /// - internal byte[] _zDestName; - - /// - /// The source database for the backup. - /// - internal IntPtr _sourceDb; - - /// - /// The source database name for the backup. - /// - internal byte[] _zSourceName; - - /// - /// The last result from the StepBackup method of the SQLite3 class. - /// This is used to determine if the call to the FinishBackup method of - /// the SQLite3 class should throw an exception when it receives a non-Ok - /// return code from the core SQLite library. - /// - internal int _stepResult; - - /// - /// Initializes the backup. - /// - /// The base SQLite object. - /// The backup handle. - /// The destination database for the backup. - /// The destination database name for the backup. - /// The source database for the backup. - /// The source database name for the backup. - internal SQLiteBackup( - SQLiteBase sqlbase, - SQLiteBackupHandle backup, - IntPtr destDb, - byte[] zDestName, - IntPtr sourceDb, - byte[] zSourceName - ) - { - _sql = sqlbase; - _sqlite_backup = backup; - _destDb = destDb; - _zDestName = zDestName; - _sourceDb = sourceDb; - _zSourceName = zSourceName; - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - #region IDisposable Members - /// - /// Disposes and finalizes the backup. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - - /////////////////////////////////////////////////////////////////////////////////////////////// - - #region IDisposable "Pattern" Members - private bool disposed; - private void CheckDisposed() /* throw */ - { -#if THROW_ON_DISPOSED - if (disposed) - throw new ObjectDisposedException(typeof(SQLiteBackup).Name); -#endif - } - - /////////////////////////////////////////////////////////////////////////////////////////////// - - private void Dispose(bool disposing) - { - if (!disposed) - { - if (disposing) - { - //////////////////////////////////// - // dispose managed resources here... - //////////////////////////////////// - - if (_sqlite_backup != null) - { - _sqlite_backup.Dispose(); - _sqlite_backup = null; - } - - _zSourceName = null; - _sourceDb = IntPtr.Zero; - _zDestName = null; - _destDb = IntPtr.Zero; - _sql = null; - } - - ////////////////////////////////////// - // release unmanaged resources here... - ////////////////////////////////////// - - disposed = true; - } - } - #endregion - - /////////////////////////////////////////////////////////////////////////////////////////////// - - #region Destructor - ~SQLiteBackup() - { - Dispose(false); - } - #endregion - } -} Index: System.Data.SQLite/SQLiteBase.cs ================================================================== --- System.Data.SQLite/SQLiteBase.cs +++ System.Data.SQLite/SQLiteBase.cs @@ -16,10 +16,12 @@ internal abstract class SQLiteBase : SQLiteConvert, IDisposable { internal SQLiteBase(SQLiteDateFormats fmt, DateTimeKind kind) : base(fmt, kind) { } + static internal object _lock = new object(); + /// /// Returns a string representing the active version of SQLite /// internal abstract string Version { get; } /// @@ -54,15 +56,14 @@ /// /// Implementers should call SQLiteFunction.BindFunctions() and save the array after opening a connection /// to bind all attributed user-defined functions and collating sequences to the new connection. /// /// The filename of the database to open. SQLite automatically creates it if it doesn't exist. - /// The flags associated with the parent connection object - /// The open flags to use when creating the connection + /// The open flags to use when creating the connection /// The maximum size of the pool for the given filename /// If true, the connection can be pulled from the connection pool - internal abstract void Open(string strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, int maxPoolSize, bool usePool); + internal abstract void Open(string strFilename, SQLiteOpenFlagsEnum flags, int maxPoolSize, bool usePool); /// /// Closes the currently-open database. /// /// /// After the database has been closed implemeters should call SQLiteFunction.UnbindFunctions() to deallocate all interop allocated @@ -76,23 +77,17 @@ internal abstract void SetTimeout(int nTimeoutMS); /// /// Returns the text of the last error issued by SQLite /// /// - internal abstract string GetLastError(); + internal abstract string SQLiteLastError(); /// /// When pooling is enabled, force this connection to be disposed rather than returned to the pool /// internal abstract void ClearPool(); - /// - /// When pooling is enabled, returns the number of pool entries matching the current file name. - /// - /// The number of pool entries matching the current file name. - internal abstract int CountPool(); - /// /// Prepares a SQL statement for execution. /// /// The source connection preparing the command. Can be null for any caller except LINQ /// The SQL command text to prepare @@ -116,23 +111,23 @@ /// The statement to reset /// Returns -1 if the schema changed while resetting, 0 if the reset was sucessful or 6 (SQLITE_LOCKED) if the reset failed due to a lock internal abstract int Reset(SQLiteStatement stmt); internal abstract void Cancel(); - internal abstract void Bind_Double(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, double value); - internal abstract void Bind_Int32(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, Int32 value); - internal abstract void Bind_UInt32(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, UInt32 value); - internal abstract void Bind_Int64(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, Int64 value); - internal abstract void Bind_UInt64(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, UInt64 value); - internal abstract void Bind_Text(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, string value); - internal abstract void Bind_Blob(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, byte[] blobData); - internal abstract void Bind_DateTime(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index, DateTime dt); - internal abstract void Bind_Null(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index); - - internal abstract int Bind_ParamCount(SQLiteStatement stmt, SQLiteConnectionFlags flags); - internal abstract string Bind_ParamName(SQLiteStatement stmt, SQLiteConnectionFlags flags, int index); - internal abstract int Bind_ParamIndex(SQLiteStatement stmt, SQLiteConnectionFlags flags, string paramName); + internal abstract void Bind_Double(SQLiteStatement stmt, int index, double value); + internal abstract void Bind_Int32(SQLiteStatement stmt, int index, Int32 value); + internal abstract void Bind_UInt32(SQLiteStatement stmt, int index, UInt32 value); + internal abstract void Bind_Int64(SQLiteStatement stmt, int index, Int64 value); + internal abstract void Bind_UInt64(SQLiteStatement stmt, int index, UInt64 value); + internal abstract void Bind_Text(SQLiteStatement stmt, int index, string value); + internal abstract void Bind_Blob(SQLiteStatement stmt, int index, byte[] blobData); + internal abstract void Bind_DateTime(SQLiteStatement stmt, int index, DateTime dt); + internal abstract void Bind_Null(SQLiteStatement stmt, int index); + + internal abstract int Bind_ParamCount(SQLiteStatement stmt); + internal abstract string Bind_ParamName(SQLiteStatement stmt, int index); + internal abstract int Bind_ParamIndex(SQLiteStatement stmt, string paramName); internal abstract int ColumnCount(SQLiteStatement stmt); internal abstract string ColumnName(SQLiteStatement stmt, int index); internal abstract TypeAffinity ColumnAffinity(SQLiteStatement stmt, int index); internal abstract string ColumnType(SQLiteStatement stmt, int index, out TypeAffinity nAffinity); @@ -203,14 +198,12 @@ /// interface, this should be pre-formatted. Consider using the /// String.Format() function. /// internal abstract void LogMessage(int iErrCode, string zMessage); -#if INTEROP_CODEC internal abstract void SetPassword(byte[] passwordBytes); internal abstract void ChangePassword(byte[] newPasswordBytes); -#endif internal abstract void SetUpdateHook(SQLiteUpdateCallback func); internal abstract void SetCommitHook(SQLiteCommitCallback func); internal abstract void SetTraceCallback(SQLiteTraceCallback func); internal abstract void SetRollbackHook(SQLiteRollbackCallback func); @@ -227,65 +220,10 @@ get; } internal abstract int FileControl(string zDbName, int op, IntPtr pArg); - /// - /// Creates a new SQLite backup object based on the provided destination - /// database connection. The source database connection is the one - /// associated with this object. The source and destination database - /// connections cannot be the same. - /// - /// The destination database connection. - /// The destination database name. - /// The source database name. - /// The newly created backup object. - internal abstract SQLiteBackup InitializeBackup( - SQLiteConnection destCnn, string destName, - string sourceName); - - /// - /// Copies up to N pages from the source database to the destination - /// database associated with the specified backup object. - /// - /// The backup object to use. - /// - /// The number of pages to copy or negative to copy all remaining pages. - /// - /// - /// Set to true if the operation needs to be retried due to database - /// locking issues. - /// - /// - /// True if there are more pages to be copied, false otherwise. - /// - internal abstract bool StepBackup(SQLiteBackup backup, int nPage, out bool retry); - - /// - /// Returns the number of pages remaining to be copied from the source - /// database to the destination database associated with the specified - /// backup object. - /// - /// The backup object to check. - /// The number of pages remaining to be copied. - internal abstract int RemainingBackup(SQLiteBackup backup); - - /// - /// Returns the total number of pages in the source database associated - /// with the specified backup object. - /// - /// The backup object to check. - /// The total number of pages in the source database. - internal abstract int PageCountBackup(SQLiteBackup backup); - - /// - /// Destroys the backup object, rolling back any backup that may be in - /// progess. - /// - /// The backup object to destroy. - internal abstract void FinishBackup(SQLiteBackup backup); - /////////////////////////////////////////////////////////////////////////////////////////////// #region IDisposable Members public void Dispose() { @@ -342,114 +280,79 @@ // These statics are here for lack of a better place to put them. // They exist here because they are called during the finalization of // a SQLiteStatementHandle, SQLiteConnectionHandle, and SQLiteFunctionCookieHandle. // Therefore these functions have to be static, and have to be low-level. - internal static string GetLastError(SQLiteConnectionHandle hdl, IntPtr db) - { - if ((hdl == null) || (db == IntPtr.Zero)) - return "null connection or database handle"; - - lock (hdl) - { - if (hdl.IsClosed || hdl.IsInvalid) - return "closed or invalid connection handle"; - -#if !SQLITE_STANDARD - int len; - return UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg_interop(db, out len), len); -#else - return UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg(db), -1); -#endif - } - -#pragma warning disable 162 - GC.KeepAlive(hdl); /* NOTE: Unreachable code. */ -#pragma warning restore 162 - } - - internal static void FinishBackup(SQLiteConnectionHandle hdl, IntPtr backup) - { - if ((hdl == null) || (backup == IntPtr.Zero)) return; - lock (hdl) - { - int n = UnsafeNativeMethods.sqlite3_backup_finish(backup); - if (n > 0) throw new SQLiteException(n, null); - } - } - - internal static void FinalizeStatement(SQLiteConnectionHandle hdl, IntPtr stmt) - { - if ((hdl == null) || (stmt == IntPtr.Zero)) return; - lock (hdl) - { -#if !SQLITE_STANDARD - int n = UnsafeNativeMethods.sqlite3_finalize_interop(stmt); -#else - int n = UnsafeNativeMethods.sqlite3_finalize(stmt); -#endif - if (n > 0) throw new SQLiteException(n, null); - } - } - - internal static void CloseConnection(SQLiteConnectionHandle hdl, IntPtr db) - { - if ((hdl == null) || (db == IntPtr.Zero)) return; - lock (hdl) - { -#if !SQLITE_STANDARD - int n = UnsafeNativeMethods.sqlite3_close_interop(db); -#else - ResetConnection(hdl, db); - int n = UnsafeNativeMethods.sqlite3_close(db); -#endif - if (n > 0) throw new SQLiteException(n, GetLastError(hdl, db)); - } - } - - internal static void ResetConnection(SQLiteConnectionHandle hdl, IntPtr db) - { - if ((hdl == null) || (db == IntPtr.Zero)) return; - if (hdl.IsClosed || hdl.IsInvalid) return; - lock (hdl) - { - IntPtr stmt = IntPtr.Zero; - int n; - do - { - stmt = UnsafeNativeMethods.sqlite3_next_stmt(db, stmt); - if (stmt != IntPtr.Zero) - { -#if !SQLITE_STANDARD - n = UnsafeNativeMethods.sqlite3_reset_interop(stmt); -#else - n = UnsafeNativeMethods.sqlite3_reset(stmt); -#endif - } - } while (stmt != IntPtr.Zero); - - if (IsAutocommit(hdl, db) == false) // a transaction is pending on the connection - { - n = UnsafeNativeMethods.sqlite3_exec(db, ToUTF8("ROLLBACK"), IntPtr.Zero, IntPtr.Zero, out stmt); - if (n > 0) throw new SQLiteException(n, GetLastError(hdl, db)); - } - } - GC.KeepAlive(hdl); - } - - internal static bool IsAutocommit(SQLiteConnectionHandle hdl, IntPtr db) - { - if (db == IntPtr.Zero) return false; - if (hdl.IsClosed || hdl.IsInvalid) return false; - lock (hdl) - { - return (UnsafeNativeMethods.sqlite3_get_autocommit(db) == 1); - } -#pragma warning disable 162 - GC.KeepAlive(hdl); /* NOTE: Unreachable code. */ -#pragma warning restore 162 - } + internal static string SQLiteLastError(SQLiteConnectionHandle db) + { +#if !SQLITE_STANDARD + int len; + return UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg_interop(db, out len), len); +#else + return UTF8ToString(UnsafeNativeMethods.sqlite3_errmsg(db), -1); +#endif + } + + internal static void FinalizeStatement(SQLiteStatementHandle stmt) + { + lock (_lock) + { +#if !SQLITE_STANDARD + int n = UnsafeNativeMethods.sqlite3_finalize_interop(stmt); +#else + int n = UnsafeNativeMethods.sqlite3_finalize(stmt); +#endif + if (n > 0) throw new SQLiteException(n, null); + } + } + + internal static void CloseConnection(SQLiteConnectionHandle db) + { + lock (_lock) + { +#if !SQLITE_STANDARD + int n = UnsafeNativeMethods.sqlite3_close_interop(db); +#else + ResetConnection(db); + int n = UnsafeNativeMethods.sqlite3_close(db); +#endif + if (n > 0) throw new SQLiteException(n, SQLiteLastError(db)); + } + } + + internal static void ResetConnection(SQLiteConnectionHandle db) + { + lock (_lock) + { + IntPtr stmt = IntPtr.Zero; + int n; + do + { + stmt = UnsafeNativeMethods.sqlite3_next_stmt(db, stmt); + if (stmt != IntPtr.Zero) + { +#if !SQLITE_STANDARD + n = UnsafeNativeMethods.sqlite3_reset_interop(stmt); +#else + n = UnsafeNativeMethods.sqlite3_reset(stmt); +#endif + } + } while (stmt != IntPtr.Zero); + + if (IsAutocommit(db) == false) // a transaction is pending on the connection + { + n = UnsafeNativeMethods.sqlite3_exec(db, ToUTF8("ROLLBACK"), IntPtr.Zero, IntPtr.Zero, out stmt); + if (n > 0) throw new SQLiteException(n, SQLiteLastError(db)); + } + } + } + + internal static bool IsAutocommit(SQLiteConnectionHandle hdl) + { + return (UnsafeNativeMethods.sqlite3_get_autocommit(hdl) == 1); + } + } internal interface ISQLiteSchemaExtensions { void BuildTempSchema(SQLiteConnection cnn); @@ -480,41 +383,14 @@ /// /// Enable logging of all SQL statements to be prepared. /// LogPrepare = 0x1, - /// - /// Enable logging of all bound parameter types and raw values. - /// - LogPreBind = 0x2, - - /// - /// Enable logging of all bound parameter strongly typed values. - /// - LogBind = 0x4, - - /// - /// Enable logging of all exceptions caught from user-provided - /// managed code called from native code via delegates. - /// - LogCallbackException = 0x8, - - /// - /// Enable logging of backup API errors. - /// - LogBackup = 0x10, - - /// - /// Enable all logging. - /// - LogAll = LogPrepare | LogPreBind | LogBind | - LogCallbackException | LogBackup, - /// /// The default extra flags for new connections. /// - Default = LogCallbackException + Default = None } // These are the options to the internal sqlite3_config call. internal enum SQLiteConfigOpsEnum { Index: System.Data.SQLite/SQLiteConnection.cs ================================================================== --- System.Data.SQLite/SQLiteConnection.cs +++ System.Data.SQLite/SQLiteConnection.cs @@ -1,9 +1,9 @@ /******************************************************** * ADO.NET 2.0 Data Provider for SQLite Version 3.X * Written by Robert Simpson (robert@blackcastlesoft.com) - * + * * Released to the public domain, use at your own risk! ********************************************************/ namespace System.Data.SQLite { @@ -91,11 +91,11 @@ /// N /// 1024 /// /// /// Password - /// {password} - Using this parameter requires that the CryptoAPI based codec be enabled at compile-time for both the native interop assembly and the core managed assemblies; otherwise, using this parameter may result in an exception being thrown when attempting to open the connection. + /// {password} /// N /// /// /// /// Enlist @@ -218,17 +218,14 @@ internal SQLiteBase _sql; /// /// The database filename minus path and extension /// private string _dataSource; - -#if INTEROP_CODEC /// /// Temporary password storage, emptied after the database has been opened /// private byte[] _password; -#endif /// /// The "stub" (i.e. placeholder) base schema name to use when returning /// column schema information. /// @@ -279,14 +276,10 @@ /// Initializes the connection with the specified connection string /// /// The connection string to use on the connection public SQLiteConnection(string connectionString) { -#if (SQLITE_STANDARD || USE_INTEROP_DLL || PLATFORM_COMPACTFRAMEWORK) && PRELOAD_NATIVE_LIBRARY - UnsafeNativeMethods.Initialize(); -#endif - #if !PLATFORM_COMPACTFRAMEWORK SQLiteLog.Initialize(); #endif _flags = SQLiteConnectionFlags.Default; @@ -331,127 +324,10 @@ } } } } - /////////////////////////////////////////////////////////////////////////////////////////////// - - #region Backup API Members - /// - /// Backs up the database, using the specified database connection as the - /// destination. - /// - /// The destination database connection. - /// The destination database name. - /// The source database name. - /// - /// The number of pages to copy or negative to copy all remaining pages. - /// - /// - /// The method to invoke between each step of the backup process. This - /// parameter may be null (i.e. no callbacks will be performed). - /// - /// - /// The number of milliseconds to sleep after encountering a locking error - /// during the backup process. A value less than zero means that no sleep - /// should be performed. - /// - public void BackupDatabase( - SQLiteConnection destination, - string destinationName, - string sourceName, - int pages, - SQLiteBackupCallback callback, - int retryMilliseconds - ) - { - CheckDisposed(); - - if (_connectionState != ConnectionState.Open) - throw new InvalidOperationException( - "Source database is not open."); - - if (destination == null) - throw new ArgumentNullException("destination"); - - if (destination._connectionState != ConnectionState.Open) - throw new ArgumentException( - "Destination database is not open.", "destination"); - - if (destinationName == null) - throw new ArgumentNullException("destinationName"); - - if (sourceName == null) - throw new ArgumentNullException("sourceName"); - - SQLiteBase sqliteBase = _sql; - - if (sqliteBase == null) - throw new InvalidOperationException( - "Connection object has an invalid handle."); - - SQLiteBackup backup = null; - - try - { - backup = sqliteBase.InitializeBackup( - destination, destinationName, sourceName); /* throw */ - - bool retry; - - while (sqliteBase.StepBackup(backup, pages, out retry)) /* throw */ - { - // - // NOTE: If a callback was supplied by our caller, call it. - // If it returns false, halt the backup process. - // - if ((callback != null) && !callback(this, sourceName, - destination, destinationName, pages, - sqliteBase.RemainingBackup(backup), - sqliteBase.PageCountBackup(backup), retry)) - { - break; - } - - // - // NOTE: If we need to retry the previous operation, wait for - // the number of milliseconds specified by our caller - // unless the caller used a negative number, in that case - // skip sleeping at all because we do not want to block - // this thread forever. - // - if (retry && (retryMilliseconds >= 0)) - System.Threading.Thread.Sleep(retryMilliseconds); - - // - // NOTE: There is no point in calling the native API to copy - // zero pages as it does nothing; therefore, stop now. - // - if (pages == 0) - break; - } - } -#if !PLATFORM_COMPACTFRAMEWORK - catch (Exception e) - { - if ((_flags & SQLiteConnectionFlags.LogBackup) == SQLiteConnectionFlags.LogBackup) - { - SQLiteLog.LogMessage(0, String.Format( - "Caught exception while backing up database: {0}", e)); - } - - throw; - } -#endif - finally - { - if (backup != null) - sqliteBase.FinishBackup(backup); /* throw */ - } - } - #endregion - /////////////////////////////////////////////////////////////////////////////////////////////// #region IDisposable "Pattern" Members private bool disposed; private void CheckDisposed() /* throw */ @@ -501,24 +377,22 @@ /// public override int ConnectionTimeout { get { - CheckDisposed(); return 30; } } #endif /// - /// Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection + /// Creates a clone of the connection. All attached databases and user-defined functions are cloned. If the existing connection is open, the cloned connection /// will also be opened. /// /// public object Clone() { - CheckDisposed(); return new SQLiteConnection(this); } /// /// Creates a database file. This just creates a zero-byte file which SQLite @@ -550,40 +424,38 @@ /// /// OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. /// /// This parameter is ignored. /// When TRUE, SQLite defers obtaining a write lock until a write operation is requested. - /// When FALSE, a writelock is obtained immediately. The default is TRUE, but in a multi-threaded multi-writer + /// When FALSE, a writelock is obtained immediately. The default is TRUE, but in a multi-threaded multi-writer /// environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. /// Returns a SQLiteTransaction object. [Obsolete("Use one of the standard BeginTransaction methods, this one will be removed soon")] public SQLiteTransaction BeginTransaction(IsolationLevel isolationLevel, bool deferredLock) { - CheckDisposed(); return (SQLiteTransaction)BeginDbTransaction(deferredLock == false ? IsolationLevel.Serializable : IsolationLevel.ReadCommitted); } /// /// OBSOLETE. Creates a new SQLiteTransaction if one isn't already active on the connection. /// /// When TRUE, SQLite defers obtaining a write lock until a write operation is requested. - /// When FALSE, a writelock is obtained immediately. The default is false, but in a multi-threaded multi-writer + /// When FALSE, a writelock is obtained immediately. The default is false, but in a multi-threaded multi-writer /// environment, one may instead choose to lock the database immediately to avoid any possible writer deadlock. /// Returns a SQLiteTransaction object. [Obsolete("Use one of the standard BeginTransaction methods, this one will be removed soon")] public SQLiteTransaction BeginTransaction(bool deferredLock) { - CheckDisposed(); return (SQLiteTransaction)BeginDbTransaction(deferredLock == false ? IsolationLevel.Serializable : IsolationLevel.ReadCommitted); } /// /// Creates a new SQLiteTransaction if one isn't already active on the connection. /// /// Supported isolation levels are Serializable, ReadCommitted and Unspecified. /// - /// Unspecified will use the default isolation level specified in the connection string. If no isolation level is specified in the + /// Unspecified will use the default isolation level specified in the connection string. If no isolation level is specified in the /// connection string, Serializable is used. /// Serializable transactions are the default. In this mode, the engine gets an immediate lock on the database, and no other threads /// may begin a transaction. Other threads may read from the database, but not write. /// With a ReadCommitted isolation level, locks are deferred and elevated as needed. It is possible for multiple threads to start /// a transaction in ReadCommitted mode, but if a thread attempts to commit a transaction while another thread @@ -590,21 +462,19 @@ /// has a ReadCommitted lock, it may timeout or cause a deadlock on both threads until both threads' CommandTimeout's are reached. /// /// Returns a SQLiteTransaction object. public new SQLiteTransaction BeginTransaction(IsolationLevel isolationLevel) { - CheckDisposed(); return (SQLiteTransaction)BeginDbTransaction(isolationLevel); } /// /// Creates a new SQLiteTransaction if one isn't already active on the connection. /// /// Returns a SQLiteTransaction object. public new SQLiteTransaction BeginTransaction() { - CheckDisposed(); return (SQLiteTransaction)BeginDbTransaction(_defaultIsolation); } /// /// Forwards to the local BeginTransaction() function @@ -628,28 +498,25 @@ /// Not implemented /// /// public override void ChangeDatabase(string databaseName) { - CheckDisposed(); throw new NotImplementedException(); } /// /// When the database connection is closed, all commands linked to this connection are automatically reset. /// public override void Close() { - CheckDisposed(); - if (_sql != null) { #if !PLATFORM_COMPACTFRAMEWORK if (_enlistment != null) { // If the connection is enlisted in a transaction scope and the scope is still active, - // we cannot truly shut down this connection until the scope has completed. Therefore make a + // we cannot truly shut down this connection until the scope has completed. Therefore make a // hidden connection temporarily to hold open the connection until the scope has completed. SQLiteConnection cnn = new SQLiteConnection(); cnn._sql = _sql; cnn._transactionLevel = _transactionLevel; cnn._enlistment = _enlistment; @@ -671,22 +538,10 @@ _transactionLevel = 0; } OnStateChange(ConnectionState.Closed); } - /// - /// Returns the number of pool entries for the file name associated with this connection. - /// - public int PoolCount - { - get - { - if (_sql == null) return 0; - return _sql.CountPool(); - } - } - /// /// Clears the connection pool associated with the connection. Any other active connections using the same database file /// will be discarded instead of returned to the pool when they are closed. /// /// @@ -837,17 +692,14 @@ #endif public override string ConnectionString { get { - CheckDisposed(); return _connectionString; } set { - CheckDisposed(); - if (value == null) throw new ArgumentNullException(); else if (_connectionState != ConnectionState.Closed) throw new InvalidOperationException(); @@ -860,11 +712,10 @@ /// Create a new SQLiteCommand and associate it with this connection. /// /// Returns an instantiated SQLiteCommand object already assigned to this connection. public new SQLiteCommand CreateCommand() { - CheckDisposed(); return new SQLiteCommand(this); } /// /// Forwards to the local CreateCommand() function @@ -883,11 +734,10 @@ #endif public override string DataSource { get { - CheckDisposed(); return _dataSource; } } /// @@ -898,11 +748,10 @@ #endif public override string Database { get { - CheckDisposed(); return "main"; } } internal static string MapUriPath(string path) @@ -914,11 +763,11 @@ else if (path.StartsWith ("/", StringComparison.OrdinalIgnoreCase)) return path; else throw new InvalidOperationException ("Invalid connection string: invalid URI"); } - + /// /// Parses the connection string into component parts /// /// The connection string to parse /// An array of key-value pairs representing each parameter of the connection string @@ -952,12 +801,10 @@ /// Manual distributed transaction enlistment support /// /// The distributed transaction to enlist in public override void EnlistTransaction(System.Transactions.Transaction transaction) { - CheckDisposed(); - if (_enlistment != null && transaction == _enlistment._scope) return; else if (_enlistment != null) throw new ArgumentException("Already enlisted in a transaction"); @@ -989,12 +836,10 @@ /// /// Opens the connection using the parameters found in the ConnectionString /// public override void Open() { - CheckDisposed(); - if (_connectionState != ConnectionState.Closed) throw new InvalidOperationException(); Close(); @@ -1075,23 +920,21 @@ else { flags |= SQLiteOpenFlagsEnum.ReadWrite; } - _sql.Open(fileName, _flags, flags, maxPoolSize, usePooling); + _sql.Open(fileName, flags, maxPoolSize, usePooling); _binaryGuid = (SQLiteConvert.ToBoolean(FindKey(opts, "BinaryGUID", Boolean.TrueString)) == true); -#if INTEROP_CODEC string password = FindKey(opts, "Password", null); if (String.IsNullOrEmpty(password) == false) _sql.SetPassword(System.Text.UTF8Encoding.UTF8.GetBytes(password)); else if (_password != null) _sql.SetPassword(_password); _password = null; -#endif _dataSource = Path.GetFileNameWithoutExtension(fileName); _version++; @@ -1179,37 +1022,28 @@ throw; } } /// - /// Opens the connection using the parameters found in the ConnectionString and then returns it. - /// - /// The current connection object. - public SQLiteConnection OpenAndReturn() - { - CheckDisposed(); Open(); return this; - } - - /// - /// Gets/sets the default command timeout for newly-created commands. This is especially useful for + /// Gets/sets the default command timeout for newly-created commands. This is especially useful for /// commands used internally such as inside a SQLiteTransaction, where setting the timeout is not possible. /// This can also be set in the ConnectionString with "Default Timeout" /// public int DefaultTimeout { - get { CheckDisposed(); return _defaultTimeout; } - set { CheckDisposed(); _defaultTimeout = value; } + get { return _defaultTimeout; } + set { _defaultTimeout = value; } } /// /// Gets/sets the extra behavioral flags for this connection. See the /// SQLiteConnectionFlags enumeration for a list of possible values. /// public SQLiteConnectionFlags Flags { - get { CheckDisposed(); return _flags; } - set { CheckDisposed(); _flags = value; } + get { return _flags; } + set { _flags = value; } } /// /// Returns the version of the underlying SQLite database engine /// @@ -1218,11 +1052,10 @@ #endif public override string ServerVersion { get { - CheckDisposed(); return SQLiteVersion; //if (_connectionState != ConnectionState.Open) // throw new InvalidOperationException(); //return _sql.Version; @@ -1237,12 +1070,10 @@ #endif public long LastInsertRowId { get { - CheckDisposed(); - if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting last insert rowid."); return _sql.LastInsertRowId; } @@ -1257,12 +1088,10 @@ #endif public int Changes { get { - CheckDisposed(); - if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting number of changes."); return _sql.Changes; } @@ -1276,12 +1105,10 @@ #endif public long MemoryUsed { get { - CheckDisposed(); - if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting memory used."); return _sql.MemoryUsed; } @@ -1295,29 +1122,17 @@ #endif public long MemoryHighwater { get { - CheckDisposed(); - if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting maximum memory used."); return _sql.MemoryHighwater; } } - /// - /// Returns a string containing the define constants (i.e. compile-time - /// options) used to compile the core managed assembly, delimited with - /// spaces. - /// - public static string DefineConstants - { - get { return SQLite3.DefineConstants; } - } - /// /// Returns the version of the underlying SQLite database engine /// public static string SQLiteVersion { @@ -1342,20 +1157,17 @@ #endif public override ConnectionState State { get { - CheckDisposed(); return _connectionState; } } /// Passes a shutdown request off to SQLite. public int Shutdown() { - CheckDisposed(); - // make sure we have an instance of the base class if (_sql == null) { SortedList opts = ParseConnectionString(_connectionString); @@ -1377,45 +1189,33 @@ } /// Enables or disabled extended result codes returned by SQLite public void SetExtendedResultCodes(bool bOnOff) { - CheckDisposed(); - if (_sql != null) _sql.SetExtendedResultCodes(bOnOff); } /// Enables or disabled extended result codes returned by SQLite public int ResultCode() { - CheckDisposed(); - - if (_sql == null) + if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting result code."); return _sql.ResultCode(); } /// Enables or disabled extended result codes returned by SQLite public int ExtendedResultCode() { - CheckDisposed(); - if (_sql == null) throw new InvalidOperationException("Database connection not valid for getting extended result code."); return _sql.ExtendedResultCode(); } /// Add a log message via the SQLite sqlite3_log interface. public void LogMessage(int iErrCode, string zMessage) { - CheckDisposed(); - - if (_sql == null) - throw new InvalidOperationException("Database connection not valid for logging message."); - _sql.LogMessage(iErrCode, zMessage); } -#if INTEROP_CODEC /// /// Change the password (or assign a password) to an open database. /// /// /// No readers or writers may be active for this process. The database must already be open @@ -1422,12 +1222,10 @@ /// and if it already was password protected, the existing password must already have been supplied. /// /// The new password to assign to the database public void ChangePassword(string newPassword) { - CheckDisposed(); - ChangePassword(String.IsNullOrEmpty(newPassword) ? null : System.Text.UTF8Encoding.UTF8.GetBytes(newPassword)); } /// /// Change the password (or assign a password) to an open database. @@ -1437,12 +1235,10 @@ /// and if it already was password protected, the existing password must already have been supplied. /// /// The new password to assign to the database public void ChangePassword(byte[] newPassword) { - CheckDisposed(); - if (_connectionState != ConnectionState.Open) throw new InvalidOperationException("Database must be opened before changing the password."); _sql.ChangePassword(newPassword); } @@ -1452,12 +1248,10 @@ /// unusable for any operation until the password has been set. /// /// The password for the database public void SetPassword(string databasePassword) { - CheckDisposed(); - SetPassword(String.IsNullOrEmpty(databasePassword) ? null : System.Text.UTF8Encoding.UTF8.GetBytes(databasePassword)); } /// /// Sets the password for a password-protected database. A password-protected database is @@ -1464,21 +1258,18 @@ /// unusable for any operation until the password has been set. /// /// The password for the database public void SetPassword(byte[] databasePassword) { - CheckDisposed(); - if (_connectionState != ConnectionState.Closed) throw new InvalidOperationException("Password can only be set before the database is opened."); if (databasePassword != null) if (databasePassword.Length == 0) databasePassword = null; _password = databasePassword; } -#endif /// /// Queries or modifies the number of retries or the retry interval (in milliseconds) for /// certain I/O operations that may fail due to anti-virus software. /// @@ -1489,12 +1280,10 @@ /// up with the final number of milliseconds to wait. A negative value will cause the /// current interval to be queried and replace that negative value. /// Zero for success, non-zero for error. public int SetAvRetry(ref int count, ref int interval) { - CheckDisposed(); - if (_connectionState != ConnectionState.Open) throw new InvalidOperationException( "Database must be opened before changing the AV retry parameters."); int rc; @@ -1600,11 +1389,10 @@ /// Returns the MetaDataCollections schema /// /// A DataTable of the MetaDataCollections schema public override DataTable GetSchema() { - CheckDisposed(); return GetSchema("MetaDataCollections", null); } /// /// Returns schema information of the specified collection @@ -1611,11 +1399,10 @@ /// /// The schema collection to retrieve /// A DataTable of the specified collection public override DataTable GetSchema(string collectionName) { - CheckDisposed(); return GetSchema(collectionName, new string[0]); } /// /// Retrieves schema information using the specified constraint(s) for the specified collection @@ -1623,12 +1410,10 @@ /// The collection to retrieve /// The restrictions to impose /// A DataTable of the specified collection public override DataTable GetSchema(string collectionName, string[] restrictionValues) { - CheckDisposed(); - if (_connectionState != ConnectionState.Open) throw new InvalidOperationException(); string[] parms = new string[5]; @@ -1926,11 +1711,11 @@ tbl.BeginLoadData(); if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main"; string master = (String.Compare(strCatalog, "temp", StringComparison.OrdinalIgnoreCase) == 0) ? _tempmasterdb : _masterdb; - + using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[{1}] WHERE [type] LIKE 'table'", strCatalog, master), this)) using (SQLiteDataReader rdTables = cmdTables.ExecuteReader()) { while (rdTables.Read()) { @@ -2498,11 +2283,11 @@ tbl.Columns.Add("UNIQUE", typeof(bool)); if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main"; string master = (String.Compare(strCatalog, "temp", StringComparison.OrdinalIgnoreCase) == 0) ? _tempmasterdb : _masterdb; - + tbl.BeginLoadData(); using (SQLiteCommand cmdViews = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[{1}] WHERE [type] LIKE 'view'", strCatalog, master), this)) using (SQLiteDataReader rdViews = cmdViews.ExecuteReader()) { @@ -2589,11 +2374,10 @@ tbl.Columns.Add("TABLE_SCHEMA", typeof(string)); tbl.Columns.Add("TABLE_NAME", typeof(string)); tbl.Columns.Add("CONSTRAINT_TYPE", typeof(string)); tbl.Columns.Add("IS_DEFERRABLE", typeof(bool)); tbl.Columns.Add("INITIALLY_DEFERRED", typeof(bool)); - tbl.Columns.Add("FKEY_ID", typeof(int)); tbl.Columns.Add("FKEY_FROM_COLUMN", typeof(string)); tbl.Columns.Add("FKEY_FROM_ORDINAL_POSITION", typeof(int)); tbl.Columns.Add("FKEY_TO_CATALOG", typeof(string)); tbl.Columns.Add("FKEY_TO_SCHEMA", typeof(string)); tbl.Columns.Add("FKEY_TO_TABLE", typeof(string)); @@ -2625,17 +2409,16 @@ { while (rdKey.Read()) { row = tbl.NewRow(); row["CONSTRAINT_CATALOG"] = strCatalog; - row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "FK_{0}_{1}_{2}", rdTables[2], rdKey.GetInt32(0), rdKey.GetInt32(1)); + row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "FK_{0}_{1}", rdTables[2], rdKey.GetInt32(0)); row["TABLE_CATALOG"] = strCatalog; row["TABLE_NAME"] = builder.UnquoteIdentifier(rdTables.GetString(2)); row["CONSTRAINT_TYPE"] = "FOREIGN KEY"; row["IS_DEFERRABLE"] = false; row["INITIALLY_DEFERRED"] = false; - row["FKEY_ID"] = rdKey[0]; row["FKEY_FROM_COLUMN"] = builder.UnquoteIdentifier(rdKey[3].ToString()); row["FKEY_TO_CATALOG"] = strCatalog; row["FKEY_TO_TABLE"] = builder.UnquoteIdentifier(rdKey[2].ToString()); row["FKEY_TO_COLUMN"] = builder.UnquoteIdentifier(rdKey[4].ToString()); row["FKEY_FROM_ORDINAL_POSITION"] = rdKey[1]; @@ -2667,23 +2450,19 @@ /// public event SQLiteUpdateEventHandler Update { add { - CheckDisposed(); - if (_updateHandler == null) { _updateCallback = new SQLiteUpdateCallback(UpdateCallback); if (_sql != null) _sql.SetUpdateHook(_updateCallback); } _updateHandler += value; } remove { - CheckDisposed(); - _updateHandler -= value; if (_updateHandler == null) { if (_sql != null) _sql.SetUpdateHook(null); _updateCallback = null; @@ -2706,23 +2485,19 @@ /// public event SQLiteCommitHandler Commit { add { - CheckDisposed(); - if (_commitHandler == null) { _commitCallback = new SQLiteCommitCallback(CommitCallback); if (_sql != null) _sql.SetCommitHook(_commitCallback); } _commitHandler += value; } remove { - CheckDisposed(); - _commitHandler -= value; if (_commitHandler == null) { if (_sql != null) _sql.SetCommitHook(null); _commitCallback = null; @@ -2736,23 +2511,19 @@ /// public event SQLiteTraceEventHandler Trace { add { - CheckDisposed(); - if (_traceHandler == null) { _traceCallback = new SQLiteTraceCallback(TraceCallback); if (_sql != null) _sql.SetTraceCallback(_traceCallback); } _traceHandler += value; } remove { - CheckDisposed(); - _traceHandler -= value; if (_traceHandler == null) { if (_sql != null) _sql.SetTraceCallback(null); _traceCallback = null; @@ -2772,23 +2543,19 @@ /// public event EventHandler RollBack { add { - CheckDisposed(); - if (_rollbackHandler == null) { _rollbackCallback = new SQLiteRollbackCallback(RollbackCallback); if (_sql != null) _sql.SetRollbackHook(_rollbackCallback); } _rollbackHandler += value; } remove { - CheckDisposed(); - _rollbackHandler -= value; if (_rollbackHandler == null) { if (_sql != null) _sql.SetRollbackHook(null); _rollbackCallback = null; @@ -2849,11 +2616,11 @@ [UnmanagedFunctionPointer(CallingConvention.Cdecl)] #endif internal delegate void SQLiteRollbackCallback(IntPtr puser); /// - /// Raised when a transaction is about to be committed. To roll back a transaction, set the + /// Raised when a transaction is about to be committed. To roll back a transaction, set the /// rollbackTrans boolean value to true. /// /// The connection committing the transaction /// Event arguments on the transaction public delegate void SQLiteCommitHandler(object sender, CommitEventArgs e); @@ -2870,59 +2637,10 @@ /// /// The connection executing the statement /// Event arguments of the trace public delegate void SQLiteTraceEventHandler(object sender, TraceEventArgs e); - /////////////////////////////////////////////////////////////////////////////////////////////// - - #region Backup API Members - /// - /// Raised between each backup step. - /// - /// - /// The source database connection. - /// - /// - /// The source database name. - /// - /// - /// The destination database connection. - /// - /// - /// The destination database name. - /// - /// - /// The number of pages copied with each step. - /// - /// - /// The number of pages remaining to be copied. - /// - /// - /// The total number of pages in the source database. - /// - /// - /// Set to true if the operation needs to be retried due to database - /// locking issues; otherwise, set to false. - /// - /// - /// True to continue with the backup process or false to halt the backup - /// process, rolling back any changes that have been made so far. - /// - public delegate bool SQLiteBackupCallback( - SQLiteConnection source, - string sourceName, - SQLiteConnection destination, - string destinationName, - int pages, - int remainingPages, - int totalPages, - bool retry - ); - #endregion - - /////////////////////////////////////////////////////////////////////////////////////////////// - /// /// Whenever an update event is triggered on a connection, this enum will indicate /// exactly what type of operation is being performed. /// public enum UpdateEventType Index: System.Data.SQLite/SQLiteConnectionPool.cs ================================================================== --- System.Data.SQLite/SQLiteConnectionPool.cs +++ System.Data.SQLite/SQLiteConnectionPool.cs @@ -6,12 +6,11 @@ ********************************************************/ namespace System.Data.SQLite { using System; - using System.Collections.Generic; - using System.Threading; + using System.Collections.Generic; internal static class SQLiteConnectionPool { /// /// Keeps track of connections made on a specified file. The PoolVersion dictates whether old objects get @@ -36,244 +35,57 @@ private static SortedList _connections = new SortedList(StringComparer.OrdinalIgnoreCase); /// /// The default version number new pools will get /// - private static int _poolVersion = 1; - - /// - /// The number of connections successfully opened from any pool. - /// This value is incremented by the Remove method. - /// - private static int _poolOpened = 0; - - /// - /// The number of connections successfully closed from any pool. - /// This value is incremented by the Add method. - /// - private static int _poolClosed = 0; - - /// - /// Counts the number of pool entries matching the specified file name. - /// - /// The file name to match or null to match all files. - /// The pool entry counts for each matching file. - /// The total number of connections successfully opened from any pool. - /// The total number of connections successfully closed from any pool. - /// The total number of pool entries for all matching files. - internal static void GetCounts( - string fileName, - ref Dictionary counts, - ref int openCount, - ref int closeCount, - ref int totalCount - ) - { - lock (_connections) - { - openCount = _poolOpened; - closeCount = _poolClosed; - - if (counts == null) - { - counts = new Dictionary( - StringComparer.OrdinalIgnoreCase); - } - - if (fileName != null) - { - Pool queue; - - if (_connections.TryGetValue(fileName, out queue)) - { - Queue poolQueue = queue.Queue; - int count = (poolQueue != null) ? poolQueue.Count : 0; - - counts.Add(fileName, count); - totalCount += count; - } - } - else - { - foreach (KeyValuePair pair in _connections) - { - if (pair.Value == null) - continue; - - Queue poolQueue = pair.Value.Queue; - int count = (poolQueue != null) ? poolQueue.Count : 0; - - counts.Add(pair.Key, count); - totalCount += count; - } - } - } - } + private static int _poolVersion = 1; /// /// Attempt to pull a pooled connection out of the queue for active duty /// /// The filename for a desired connection - /// The maximum size the connection pool for the filename can be - /// The pool version the returned connection will belong to - /// Returns NULL if no connections were available. Even if none are, the poolversion will still be a valid pool version - internal static SQLiteConnectionHandle Remove(string fileName, int maxPoolSize, out int version) - { - int localVersion; - Queue poolQueue; - - // - // NOTE: This lock cannot be held while checking the queue for available - // connections because other methods of this class are called from - // the GC finalizer thread and we use the WaitForPendingFinalizers - // method (below). Holding this lock while calling that method - // would therefore result in a deadlock. Instead, this lock is - // held only while a temporary copy of the queue is created, and - // if necessary, when committing changes back to that original - // queue prior to returning from this method. - // - lock (_connections) - { - Pool queue; - - // Default to the highest pool version - version = _poolVersion; - - // If we didn't find a pool for this file, create one even though it will be empty. - // We have to do this here because otherwise calling ClearPool() on the file will not work for active connections - // that have never seen the pool yet. - if (_connections.TryGetValue(fileName, out queue) == false) - { - queue = new Pool(_poolVersion, maxPoolSize); - _connections.Add(fileName, queue); - - return null; - } - - // We found a pool for this file, so use its version number - version = localVersion = queue.PoolVersion; - queue.MaxPoolSize = maxPoolSize; - - ResizePool(queue, false); - - // Try and get a pooled connection from the queue - poolQueue = queue.Queue; - if (poolQueue == null) return null; - - // - // NOTE: Temporarily tranfer the queue for this file into a local - // variable. The queue for this file will be modified and - // then committed back to the real pool list (below) prior - // to returning from this method. - // - _connections.Remove(fileName); - poolQueue = new Queue(poolQueue); - } - - try - { - while (poolQueue.Count > 0) - { - WeakReference cnn = poolQueue.Dequeue(); - if (cnn == null) continue; - - SQLiteConnectionHandle hdl = cnn.Target as SQLiteConnectionHandle; - if (hdl == null) continue; - - // - // BUGFIX: For ticket [996d13cd87], step #1. After this point, - // make sure that the finalizer for the connection - // handle just obtained from the queue cannot START - // running (i.e. it may still be pending but it will no - // longer start after this point). - // - GC.SuppressFinalize(hdl); - - try - { - // - // BUGFIX: For ticket [996d13cd87], step #2. Now, we must wait - // for all pending finalizers which have STARTED running - // and have not yet COMPLETED. This must be done just - // in case the finalizer for the connection handle just - // obtained from the queue has STARTED running at some - // point before SuppressFinalize was called on it. - // - // After this point, checking properties of the - // connection handle (e.g. IsClosed) should work - // reliably without having to worry that they will - // (due to the finalizer) change out from under us. - // - GC.WaitForPendingFinalizers(); - - // - // BUGFIX: For ticket [996d13cd87], step #3. Next, verify that - // the connection handle is actually valid and [still?] - // not closed prior to actually returning it to our - // caller. - // - if (!hdl.IsClosed && !hdl.IsInvalid) - { - Interlocked.Increment(ref _poolOpened); - return hdl; - } - } - finally - { - // - // BUGFIX: For ticket [996d13cd87], step #4. Next, we must - // re-register the connection handle for finalization - // now that we have a strong reference to it (i.e. the - // finalizer will not run at least until the connection - // is subsequently closed). - // - GC.ReRegisterForFinalize(hdl); - } - - GC.KeepAlive(hdl); - } - } - finally - { - // - // BUGFIX: For ticket [996d13cd87], step #5. Finally, commit any - // changes to the pool/queue for this database file. - // - lock (_connections) - { - // - // NOTE: We must check [again] if a pool exists for this file - // because one may have been added while the search for - // an available connection was in progress (above). - // - Pool queue; - Queue newPoolQueue; - bool addPool; - - if (_connections.TryGetValue(fileName, out queue)) - { - addPool = false; - } - else - { - addPool = true; - queue = new Pool(localVersion, maxPoolSize); - } - - newPoolQueue = queue.Queue; - - while (poolQueue.Count > 0) - newPoolQueue.Enqueue(poolQueue.Dequeue()); - - ResizePool(queue, false); - - if (addPool) - _connections.Add(fileName, queue); - } - } - - return null; + /// The maximum size the connection pool for the filename can be + /// The pool version the returned connection will belong to + /// Returns NULL if no connections were available. Even if none are, the poolversion will still be a valid pool version + internal static SQLiteConnectionHandle Remove(string fileName, int maxPoolSize, out int version) + { + lock (_connections) + { + Pool queue; + + // Default to the highest pool version + version = _poolVersion; + + // If we didn't find a pool for this file, create one even though it will be empty. + // We have to do this here because otherwise calling ClearPool() on the file will not work for active connections + // that have never seen the pool yet. + if (_connections.TryGetValue(fileName, out queue) == false) + { + queue = new Pool(_poolVersion, maxPoolSize); + _connections.Add(fileName, queue); + + return null; + } + + // We found a pool for this file, so use its version number + version = queue.PoolVersion; + queue.MaxPoolSize = maxPoolSize; + + ResizePool(queue, false); + + // Try and get a pooled connection from the queue + while (queue.Queue.Count > 0) + { + WeakReference cnn = queue.Queue.Dequeue(); + SQLiteConnectionHandle hdl = cnn.Target as SQLiteConnectionHandle; + if (hdl != null) + { + return hdl; + } + } + return null; + } } /// /// Clears out all pooled connections and rev's up the default pool version to force all old active objects /// not in the pool to get discarded rather than returned to their pools. @@ -281,26 +93,19 @@ internal static void ClearAllPools() { lock (_connections) { foreach (KeyValuePair pair in _connections) - { - if (pair.Value == null) - continue; - - Queue poolQueue = pair.Value.Queue; - - while (poolQueue.Count > 0) - { - WeakReference cnn = poolQueue.Dequeue(); - if (cnn == null) continue; + { + while (pair.Value.Queue.Count > 0) + { + WeakReference cnn = pair.Value.Queue.Dequeue(); SQLiteConnectionHandle hdl = cnn.Target as SQLiteConnectionHandle; if (hdl != null) { hdl.Dispose(); - } - GC.KeepAlive(hdl); + } } // Keep track of the highest revision so we can go one higher when we're finished if (_poolVersion <= pair.Value.PoolVersion) _poolVersion = pair.Value.PoolVersion + 1; @@ -323,25 +128,19 @@ lock (_connections) { Pool queue; if (_connections.TryGetValue(fileName, out queue) == true) { - queue.PoolVersion++; - - Queue poolQueue = queue.Queue; - if (poolQueue == null) return; - - while (poolQueue.Count > 0) - { - WeakReference cnn = poolQueue.Dequeue(); - if (cnn == null) continue; + queue.PoolVersion++; + while (queue.Queue.Count > 0) + { + WeakReference cnn = queue.Queue.Dequeue(); SQLiteConnectionHandle hdl = cnn.Target as SQLiteConnectionHandle; if (hdl != null) { hdl.Dispose(); - } - GC.KeepAlive(hdl); + } } } } } @@ -360,23 +159,18 @@ { // If the queue doesn't exist in the pool, then it must've been cleared sometime after the connection was created. Pool queue; if (_connections.TryGetValue(fileName, out queue) == true && version == queue.PoolVersion) { - ResizePool(queue, true); - - Queue poolQueue = queue.Queue; - if (poolQueue == null) return; - - poolQueue.Enqueue(new WeakReference(hdl, false)); - Interlocked.Increment(ref _poolClosed); + ResizePool(queue, true); + queue.Queue.Enqueue(new WeakReference(hdl, false)); + GC.KeepAlive(hdl); } else { hdl.Close(); - } - GC.KeepAlive(hdl); + } } } /// /// We don't have to thread-lock anything in this function, because it's only called by other functions above @@ -387,24 +181,19 @@ /// to take one more than it needs from the pool private static void ResizePool(Pool queue, bool forAdding) { int target = queue.MaxPoolSize; - if (forAdding && target > 0) target--; - - Queue poolQueue = queue.Queue; - if (poolQueue == null) return; - - while (poolQueue.Count > target) - { - WeakReference cnn = poolQueue.Dequeue(); - if (cnn == null) continue; + if (forAdding && target > 0) target--; + + while (queue.Queue.Count > target) + { + WeakReference cnn = queue.Queue.Dequeue(); SQLiteConnectionHandle hdl = cnn.Target as SQLiteConnectionHandle; if (hdl != null) { hdl.Dispose(); - } - GC.KeepAlive(hdl); + } } } } } Index: System.Data.SQLite/SQLiteConvert.cs ================================================================== --- System.Data.SQLite/SQLiteConvert.cs +++ System.Data.SQLite/SQLiteConvert.cs @@ -6,15 +6,10 @@ ********************************************************/ namespace System.Data.SQLite { using System; - -#if DEBUG - using System.Diagnostics; -#endif - using System.Runtime.InteropServices; using System.Collections.Generic; using System.Globalization; using System.Text; @@ -74,22 +69,10 @@ "yyyy-MM-dd", "yyyyMMdd", "yy-MM-dd" }; - /// - /// The internal default format for UTC DateTime values when converting - /// to a string. - /// - private static readonly string _datetimeFormatUtc = _datetimeFormats[5]; - - /// - /// The internal default format for local DateTime values when converting - /// to a string. - /// - private static readonly string _datetimeFormatLocal = _datetimeFormats[19]; - /// /// An UTF-8 Encoding instance, so we can convert strings to and from UTF-8 /// private static Encoding _utf8 = new UTF8Encoding(); /// @@ -360,61 +343,36 @@ public static double ToJulianDay(DateTime value) { return value.ToOADate() + OleAutomationEpochAsJulianDay; } - /// - /// Converts a DateTime struct to the whole number of seconds since the - /// Unix epoch. - /// - /// The DateTime to convert - /// The whole number of seconds since the Unix epoch - public static long ToUnixEpoch(DateTime value) - { - return (value.Subtract(UnixEpoch).Ticks / TimeSpan.TicksPerSecond); - } - - /// - /// Returns the default DateTime format string to use for the specified - /// DateTimeKind. - /// - /// The DateTimeKind to use. - /// - /// The default DateTime format string to use for the specified DateTimeKind. - /// - private static string GetDateTimeKindFormat(DateTimeKind kind) - { - return (kind == DateTimeKind.Utc) ? _datetimeFormatUtc : _datetimeFormatLocal; - } - /// /// Converts a DateTime to a string value, using the current DateTimeFormat specified for the connection when it was opened. /// /// The DateTime value to convert /// Either a string containing the long integer number of 100-nanosecond units since System.DateTime.MinValue, a /// Julian day double, an integer number of seconds since the Unix epoch, a culture-independent formatted date and time /// string, a formatted date and time string in the current culture, or an ISO8601-format date/time string. public string ToString(DateTime dateValue) { - switch (_datetimeFormat) - { - case SQLiteDateFormats.Ticks: - return dateValue.Ticks.ToString(CultureInfo.InvariantCulture); - case SQLiteDateFormats.JulianDay: - return ToJulianDay(dateValue).ToString(CultureInfo.InvariantCulture); - case SQLiteDateFormats.UnixEpoch: - return ((long)(dateValue.Subtract(UnixEpoch).Ticks / TimeSpan.TicksPerSecond)).ToString(); - case SQLiteDateFormats.InvariantCulture: - return dateValue.ToString(FullFormat, CultureInfo.InvariantCulture); - case SQLiteDateFormats.CurrentCulture: - return dateValue.ToString(FullFormat, CultureInfo.CurrentCulture); - default: - return (dateValue.Kind == DateTimeKind.Unspecified) ? - DateTime.SpecifyKind(dateValue, _datetimeKind).ToString( - GetDateTimeKindFormat(_datetimeKind), CultureInfo.InvariantCulture) : - dateValue.ToString(GetDateTimeKindFormat(dateValue.Kind), CultureInfo.InvariantCulture); - } + switch (_datetimeFormat) + { + case SQLiteDateFormats.Ticks: + return dateValue.Ticks.ToString(CultureInfo.InvariantCulture); + case SQLiteDateFormats.JulianDay: + return ToJulianDay(dateValue).ToString(CultureInfo.InvariantCulture); + case SQLiteDateFormats.UnixEpoch: + return ((long)(dateValue.Subtract(UnixEpoch).Ticks / TimeSpan.TicksPerSecond)).ToString(); + case SQLiteDateFormats.InvariantCulture: + return dateValue.ToString(FullFormat, CultureInfo.InvariantCulture); + case SQLiteDateFormats.CurrentCulture: + return dateValue.ToString(FullFormat, CultureInfo.CurrentCulture); + default: + return (dateValue.Kind == DateTimeKind.Utc) ? + dateValue.ToString(_datetimeFormats[5], CultureInfo.InvariantCulture) : // include "Z" + dateValue.ToString(_datetimeFormats[19], CultureInfo.InvariantCulture); + } } /// /// Internal function to convert a UTF-8 encoded IntPtr of the specified length to a DateTime. /// @@ -734,19 +692,11 @@ { if (_dbtypeNames[n].dataType == typ) return _dbtypeNames[n].typeName; } - string defaultTypeName = String.Empty; - -#if DEBUG && !NET_COMPACT_20 - Trace.WriteLine(String.Format( - "WARNING: Type mapping failed, returning default name \"{0}\" for type {1}.", - defaultTypeName, typ)); -#endif - - return defaultTypeName; + return String.Empty; } private static SQLiteTypeNames[] _dbtypeNames = { new SQLiteTypeNames("INTEGER", DbType.Int64), new SQLiteTypeNames("TINYINT", DbType.Byte), @@ -848,10 +798,12 @@ /// /// The name of the type to match /// The .NET DBType the text evaluates to. internal static DbType TypeNameToDbType(string Name) { + if (String.IsNullOrEmpty(Name)) return DbType.Object; + lock (_syncRoot) { if (_typeNames == null) { _typeNames = new Dictionary( @@ -909,12 +861,10 @@ _typeNames.Add(typeName.typeName, typeName); } } } - if (String.IsNullOrEmpty(Name)) return DbType.Object; - SQLiteTypeNames value; if (_typeNames.TryGetValue(Name, out value)) { return value.dataType; @@ -922,25 +872,17 @@ else { int index = Name.IndexOf('('); if ((index > 0) && - _typeNames.TryGetValue(Name.Substring(0, index).TrimEnd(), out value)) + _typeNames.TryGetValue(Name.Substring(0, index), out value)) { return value.dataType; } } - DbType defaultDbType = DbType.Object; - -#if DEBUG && !NET_COMPACT_20 - Trace.WriteLine(String.Format( - "WARNING: Type mapping failed, returning default type {0} for name \"{1}\".", - defaultDbType, Name)); -#endif - - return defaultDbType; + return DbType.Object; } #endregion private static object _syncRoot = new object(); private static Dictionary _typeNames = null; Index: System.Data.SQLite/SQLiteDataReader.cs ================================================================== --- System.Data.SQLite/SQLiteDataReader.cs +++ System.Data.SQLite/SQLiteDataReader.cs @@ -7,11 +7,10 @@ namespace System.Data.SQLite { using System; using System.Collections.Generic; - using System.Collections.Specialized; using System.Data; using System.Data.Common; using System.Globalization; /// @@ -285,11 +284,11 @@ return _fieldCount + _keyInfo.Count; } } /// - /// Returns the number of visible fields in the current resultset + /// Returns the number of visible fielsd in the current resultset /// public override int VisibleFieldCount { get { @@ -1062,46 +1061,15 @@ { values[n] = GetValue(n); } return nMax; - } - - /// - /// Returns a collection containing all the column names and values for the - /// current row of data in the current resultset, if any. If there is no - /// current row or no current resultset, an exception may be thrown. - /// - /// - /// The collection containing the column name and value information for the - /// current row of data in the current resultset or null if this information - /// cannot be obtained. - /// - public NameValueCollection GetValues() - { - CheckDisposed(); - - if ((_activeStatement == null) || (_activeStatement._sql == null)) - throw new InvalidOperationException(); - - int nMax = VisibleFieldCount; - NameValueCollection result = new NameValueCollection(nMax); - - for (int n = 0; n < nMax; n++) - { - string name = _activeStatement._sql.ColumnName(_activeStatement, n); - string value = _activeStatement._sql.GetText(_activeStatement, n); - - result.Add(name, value); - } - - return result; - } - - /// - /// Returns True if the resultset has rows that can be fetched - /// + } + + /// + /// Returns True if the resultset has rows that can be fetched + /// public override bool HasRows { get { CheckDisposed(); DELETED System.Data.SQLite/SQLiteDefineConstants.cs Index: System.Data.SQLite/SQLiteDefineConstants.cs ================================================================== --- System.Data.SQLite/SQLiteDefineConstants.cs +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************** - * ADO.NET 2.0 Data Provider for SQLite Version 3.X - * Written by Robert Simpson (robert@blackcastlesoft.com) - * - * Released to the public domain, use at your own risk! - ********************************************************/ - -using System.Collections.Generic; - -namespace System.Data.SQLite -{ - internal static class SQLiteDefineConstants - { - public static readonly IList OptionList = new List(new string[] { -#if DEBUG - "DEBUG", -#endif - -#if INTEROP_CODEC - "INTEROP_CODEC", -#endif - -#if INTEROP_EXTENSION_FUNCTIONS - "INTEROP_EXTENSION_FUNCTIONS", -#endif - -#if NET_20 - "NET_20", -#endif - -#if NET_COMPACT_20 - "NET_COMPACT_20", -#endif - -#if PLATFORM_COMPACTFRAMEWORK - "PLATFORM_COMPACTFRAMEWORK", -#endif - -#if PRELOAD_NATIVE_LIBRARY - "PRELOAD_NATIVE_LIBRARY", -#endif - -#if RETARGETABLE - "RETARGETABLE", -#endif - -#if SQLITE_STANDARD - "SQLITE_STANDARD", -#endif - -#if THROW_ON_DISPOSED - "THROW_ON_DISPOSED", -#endif - -#if TRACE - "TRACE", -#endif - -#if USE_INTEROP_DLL - "USE_INTEROP_DLL", -#endif - - null - }); - } -} Index: System.Data.SQLite/SQLiteFunction.cs ================================================================== --- System.Data.SQLite/SQLiteFunction.cs +++ System.Data.SQLite/SQLiteFunction.cs @@ -32,39 +32,21 @@ { private class AggregateData { internal int _count = 1; internal object _data; - } - - ///////////////////////////////////////////////////////////////////////// - - #region Private Constants - /// - /// The error code used for logging exceptions caught in user-provided - /// code. - /// - private const int COR_E_EXCEPTION = unchecked((int)0x80131500); - #endregion - - ///////////////////////////////////////////////////////////////////////// + } /// /// The base connection this function is attached to /// internal SQLiteBase _base; /// /// Internal array used to keep track of aggregate function context data - /// - private Dictionary _contextDataList; - - /// - /// The connection flags associated with this object (this should be the - /// same value as the flags associated with the parent connection object). - /// - private SQLiteConnectionFlags _flags; + /// + private Dictionary _contextDataList; /// /// Holds a reference to the callback function for user functions /// private SQLiteCallback _InvokeFunc; @@ -96,11 +78,11 @@ /// /// Internal constructor, initializes the function's internal variables. /// protected SQLiteFunction() { - _contextDataList = new Dictionary(); + _contextDataList = new Dictionary(); } /////////////////////////////////////////////////////////////////////////////////////////////// #region IDisposable Members @@ -143,26 +125,24 @@ // dispose managed resources here... //////////////////////////////////// IDisposable disp; - foreach (KeyValuePair kv in _contextDataList) + foreach (KeyValuePair kv in _contextDataList) { disp = kv.Value._data as IDisposable; if (disp != null) disp.Dispose(); } _contextDataList.Clear(); - _contextDataList = null; - - _flags = SQLiteConnectionFlags.None; _InvokeFunc = null; _StepFunc = null; _FinalFunc = null; _CompareFunc = null; _base = null; + _contextDataList = null; } ////////////////////////////////////// // release unmanaged resources here... ////////////////////////////////////// @@ -367,285 +347,95 @@ return; } } /// - /// Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method. - /// WARNING: Must not throw exceptions. + /// Internal scalar callback function, which wraps the raw context pointer and calls the virtual Invoke() method. /// /// A raw context pointer /// Number of arguments passed in - /// A pointer to the array of arguments - internal void ScalarCallback(IntPtr context, int nArgs, IntPtr argsptr) - { - try - { - _context = context; - SetReturnValue(context, - Invoke(ConvertParams(nArgs, argsptr))); /* throw */ - } -#if !PLATFORM_COMPACTFRAMEWORK - catch (Exception e) /* NOTE: Must catch ALL. */ - { - try - { - if ((_flags & SQLiteConnectionFlags.LogCallbackException) == - SQLiteConnectionFlags.LogCallbackException) - { - SQLiteLog.LogMessage(COR_E_EXCEPTION, String.Format( - "Caught exception in \"Invoke\" method: {0}", - e)); /* throw */ - } - } - catch - { - // do nothing. - } - } -#else - catch /* NOTE: Must catch ALL. */ - { - // do nothing (Windows CE). - } -#endif + /// A pointer to the array of arguments + internal void ScalarCallback(IntPtr context, int nArgs, IntPtr argsptr) + { + _context = context; + SetReturnValue(context, Invoke(ConvertParams(nArgs, argsptr))); } /// - /// Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. - /// WARNING: Must not throw exceptions. + /// Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. /// /// Not used /// Length of the string pv1 /// Pointer to the first string to compare /// Length of the string pv2 /// Pointer to the second string to compare /// Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater - /// than the second. Returns 0 if an exception is caught. - internal int CompareCallback(IntPtr ptr, int len1, IntPtr ptr1, int len2, IntPtr ptr2) - { - try - { - return Compare(SQLiteConvert.UTF8ToString(ptr1, len1), - SQLiteConvert.UTF8ToString(ptr2, len2)); /* throw */ - } -#if !PLATFORM_COMPACTFRAMEWORK - catch (Exception e) /* NOTE: Must catch ALL. */ - { - try - { - if ((_flags & SQLiteConnectionFlags.LogCallbackException) == - SQLiteConnectionFlags.LogCallbackException) - { - SQLiteLog.LogMessage(COR_E_EXCEPTION, String.Format( - "Caught exception in \"Compare\" (UTF8) method: {0}", - e)); /* throw */ - } - } - catch - { - // do nothing. - } - } -#else - catch /* NOTE: Must catch ALL. */ - { - // do nothing (Windows CE). - } -#endif - - // - // NOTE: This must be done to prevent the core SQLite library from - // using our (invalid) result. - // - if (_base != null) - _base.Cancel(); - - return 0; - } - - /// - /// Internal collation sequence function, which wraps up the raw string pointers and executes the Compare() virtual function. - /// WARNING: Must not throw exceptions. - /// - /// Not used - /// Length of the string pv1 - /// Pointer to the first string to compare - /// Length of the string pv2 - /// Pointer to the second string to compare - /// Returns -1 if the first string is less than the second. 0 if they are equal, or 1 if the first string is greater - /// than the second. Returns 0 if an exception is caught. - internal int CompareCallback16(IntPtr ptr, int len1, IntPtr ptr1, int len2, IntPtr ptr2) - { - try - { - return Compare(SQLite3_UTF16.UTF16ToString(ptr1, len1), - SQLite3_UTF16.UTF16ToString(ptr2, len2)); /* throw */ - } -#if !PLATFORM_COMPACTFRAMEWORK - catch (Exception e) /* NOTE: Must catch ALL. */ - { - try - { - if ((_flags & SQLiteConnectionFlags.LogCallbackException) == - SQLiteConnectionFlags.LogCallbackException) - { - SQLiteLog.LogMessage(COR_E_EXCEPTION, String.Format( - "Caught exception in \"Compare\" (UTF16) method: {0}", - e)); /* throw */ - } - } - catch - { - // do nothing. - } - } -#else - catch /* NOTE: Must catch ALL. */ - { - // do nothing (Windows CE). - } -#endif - - // - // NOTE: This must be done to prevent the core SQLite library from - // using our (invalid) result. - // - if (_base != null) - _base.Cancel(); - - return 0; - } - - /// - /// The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method. - /// WARNING: Must not throw exceptions. + /// than the second. + internal int CompareCallback(IntPtr ptr, int len1, IntPtr ptr1, int len2, IntPtr ptr2) + { + return Compare(SQLiteConvert.UTF8ToString(ptr1, len1), SQLiteConvert.UTF8ToString(ptr2, len2)); + } + + internal int CompareCallback16(IntPtr ptr, int len1, IntPtr ptr1, int len2, IntPtr ptr2) + { + return Compare(SQLite3_UTF16.UTF16ToString(ptr1, len1), SQLite3_UTF16.UTF16ToString(ptr2, len2)); + } + + /// + /// The internal aggregate Step function callback, which wraps the raw context pointer and calls the virtual Step() method. /// /// /// This function takes care of doing the lookups and getting the important information put together to call the Step() function. /// That includes pulling out the user's contextData and updating it after the call is made. We use a sorted list for this so /// binary searches can be done to find the data. /// /// A raw context pointer /// Number of arguments passed in - /// A pointer to the array of arguments - internal void StepCallback(IntPtr context, int nArgs, IntPtr argsptr) - { - try - { - AggregateData data = null; - - if (_base != null) - { - IntPtr nAux = _base.AggregateContext(context); - - if ((_contextDataList != null) && - !_contextDataList.TryGetValue(nAux, out data)) - { - data = new AggregateData(); - _contextDataList[nAux] = data; - } - } - - if (data == null) - data = new AggregateData(); - - try - { - _context = context; - Step(ConvertParams(nArgs, argsptr), - data._count, ref data._data); /* throw */ - } - finally - { - data._count++; - } - } -#if !PLATFORM_COMPACTFRAMEWORK - catch (Exception e) /* NOTE: Must catch ALL. */ - { - try - { - if ((_flags & SQLiteConnectionFlags.LogCallbackException) == - SQLiteConnectionFlags.LogCallbackException) - { - SQLiteLog.LogMessage(COR_E_EXCEPTION, String.Format( - "Caught exception in \"Step\" method: {1}", - e)); /* throw */ - } - } - catch - { - // do nothing. - } - } -#else - catch /* NOTE: Must catch ALL. */ - { - // do nothing (Windows CE). - } -#endif + /// A pointer to the array of arguments + internal void StepCallback(IntPtr context, int nArgs, IntPtr argsptr) + { + long nAux; + AggregateData data; + + nAux = (long)_base.AggregateContext(context); + if (_contextDataList.TryGetValue(nAux, out data) == false) + { + data = new AggregateData(); + _contextDataList[nAux] = data; + } + + try + { + _context = context; + Step(ConvertParams(nArgs, argsptr), data._count, ref data._data); + } + finally + { + data._count++; + } } /// - /// An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method. - /// WARNING: Must not throw exceptions. + /// An internal aggregate Final function callback, which wraps the context pointer and calls the virtual Final() method. /// - /// A raw context pointer - internal void FinalCallback(IntPtr context) - { - try - { - object obj = null; - - if (_base != null) - { - IntPtr n = _base.AggregateContext(context); - AggregateData aggData; - - if ((_contextDataList != null) && - _contextDataList.TryGetValue(n, out aggData)) - { - obj = aggData._data; - _contextDataList.Remove(n); - } - } - - try - { - _context = context; - SetReturnValue(context, Final(obj)); /* throw */ - } - finally - { - IDisposable disp = obj as IDisposable; - if (disp != null) disp.Dispose(); /* throw */ - } - } -#if !PLATFORM_COMPACTFRAMEWORK - catch (Exception e) /* NOTE: Must catch ALL. */ - { - try - { - if ((_flags & SQLiteConnectionFlags.LogCallbackException) == - SQLiteConnectionFlags.LogCallbackException) - { - SQLiteLog.LogMessage(COR_E_EXCEPTION, String.Format( - "Caught exception in \"Final\" method: {1}", - e)); /* throw */ - } - } - catch - { - // do nothing. - } - } -#else - catch /* NOTE: Must catch ALL. */ - { - // do nothing (Windows CE). - } -#endif + /// A raw context pointer + internal void FinalCallback(IntPtr context) + { + long n = (long)_base.AggregateContext(context); + object obj = null; + + if (_contextDataList.ContainsKey(n)) + { + obj = _contextDataList[n]._data; + _contextDataList.Remove(n); + } + + _context = context; + SetReturnValue(context, Final(obj)); + + IDisposable disp = obj as IDisposable; + if (disp != null) disp.Dispose(); } /// /// Using reflection, enumerate all assemblies in the current appdomain looking for classes that /// have a SQLiteFunctionAttribute attribute, and registering them accordingly. @@ -747,24 +537,21 @@ /// /// /// The wrapper functions that interop with SQLite will create a unique cookie value, which internally is a pointer to /// all the wrapped callback functions. The interop function uses it to map CDecl callbacks to StdCall callbacks. /// - /// The base object on which the functions are to bind - /// The flags associated with the parent connection object + /// The base object on which the functions are to bind /// Returns an array of functions which the connection object should retain until the connection is closed. - internal static SQLiteFunction[] BindFunctions(SQLiteBase sqlbase, SQLiteConnectionFlags flags) + internal static SQLiteFunction[] BindFunctions(SQLiteBase sqlbase) { SQLiteFunction f; List lFunctions = new List(); foreach (SQLiteFunctionAttribute pr in _registeredFunctions) { - f = (SQLiteFunction)Activator.CreateInstance(pr._instanceType); - - f._base = sqlbase; - f._flags = flags; + f = (SQLiteFunction)Activator.CreateInstance(pr._instanceType); + f._base = sqlbase; f._InvokeFunc = (pr.FuncType == FunctionType.Scalar) ? new SQLiteCallback(f.ScalarCallback) : null; f._StepFunc = (pr.FuncType == FunctionType.Aggregate) ? new SQLiteCallback(f.StepCallback) : null; f._FinalFunc = (pr.FuncType == FunctionType.Aggregate) ? new SQLiteFinalCallback(f.FinalCallback) : null; f._CompareFunc = (pr.FuncType == FunctionType.Collation) ? new SQLiteCollation(f.CompareCallback) : null; f._CompareFunc16 = (pr.FuncType == FunctionType.Collation) ? new SQLiteCollation(f.CompareCallback16) : null; @@ -983,8 +770,8 @@ /// The second array to compare /// -1 if c1 is less than c2, 0 if c1 is equal to c2, and 1 if c1 is greater than c2 public int Compare(char[] c1, char[] c2) { return _func._base.ContextCollateCompare(Encoding, _func._context, c1, c2); - } - } + } + } } Index: System.Data.SQLite/SQLiteStatement.cs ================================================================== --- System.Data.SQLite/SQLiteStatement.cs +++ System.Data.SQLite/SQLiteStatement.cs @@ -40,37 +40,30 @@ /// internal SQLiteParameter[] _paramValues; /// /// Command this statement belongs to (if any) /// - internal SQLiteCommand _command; - - /// - /// The flags associated with the parent connection object. - /// - private SQLiteConnectionFlags _flags; + internal SQLiteCommand _command; private string[] _types; /// /// Initializes the statement and attempts to get all information about parameters in the statement - /// - /// The base SQLite object - /// The flags associated with the parent connection object + /// + /// The base SQLite object /// The statement /// The command text for this statement - /// The previous command in a multi-statement command - internal SQLiteStatement(SQLiteBase sqlbase, SQLiteConnectionFlags flags, SQLiteStatementHandle stmt, string strCommand, SQLiteStatement previous) + /// The previous command in a multi-statement command + internal SQLiteStatement(SQLiteBase sqlbase, SQLiteStatementHandle stmt, string strCommand, SQLiteStatement previous) { _sql = sqlbase; _sqlite_stmt = stmt; - _sqlStatement = strCommand; - _flags = flags; + _sqlStatement = strCommand; // Determine parameters for this statement (if any) and prepare space for them. int nCmdStart = 0; - int n = _sql.Bind_ParamCount(this, _flags); + int n = _sql.Bind_ParamCount(this); int x; string s; if (n > 0) { @@ -79,12 +72,12 @@ _paramNames = new string[n]; _paramValues = new SQLiteParameter[n]; for (x = 0; x < n; x++) - { - s = _sql.Bind_ParamName(this, _flags, x + 1); + { + s = _sql.Bind_ParamName(this, x + 1); if (String.IsNullOrEmpty(s)) { s = String.Format(CultureInfo.InvariantCulture, ";{0}", nCmdStart); nCmdStart++; _unnamedParameters++; @@ -193,18 +186,18 @@ return false; } /// /// Bind all parameters, making sure the caller didn't miss any - /// + /// internal void BindParameters() { if (_paramNames == null) return; int x = _paramNames.Length; for (int n = 0; n < x; n++) - { + { BindParameter(n + 1, _paramValues[n]); } } /// @@ -262,101 +255,90 @@ } } /// /// Perform the bind operation for an individual parameter - /// + /// /// The index of the parameter to bind - /// The parameter we're binding + /// The parameter we're binding private void BindParameter(int index, SQLiteParameter param) { if (param == null) throw new SQLiteException((int)SQLiteErrorCode.Error, "Insufficient parameters supplied to the command"); object obj = param.Value; - DbType objType = param.DbType; - - if ((obj != null) && (objType == DbType.Object)) - objType = SQLiteConvert.TypeToDbType(obj.GetType()); - -#if !PLATFORM_COMPACTFRAMEWORK - if ((_flags & SQLiteConnectionFlags.LogPreBind) == SQLiteConnectionFlags.LogPreBind) - { - IntPtr handle = _sqlite_stmt; - - SQLiteLog.LogMessage(0, String.Format( - "Binding statement {0} paramter #{1} with database type {2} and raw value {{{3}}}...", - handle, index, objType, obj)); - } -#endif - - if ((obj == null) || Convert.IsDBNull(obj)) - { - _sql.Bind_Null(this, _flags, index); + DbType objType = param.DbType; + + if (Convert.IsDBNull(obj) || obj == null) + { + _sql.Bind_Null(this, index); return; } + if (objType == DbType.Object) + objType = SQLiteConvert.TypeToDbType(obj.GetType()); + switch (objType) { case DbType.Date: case DbType.Time: case DbType.DateTime: // // NOTE: The old method (commented below) does not honor the selected date format // for the connection. - // _sql.Bind_DateTime(this, index, Convert.ToDateTime(obj, CultureInfo.CurrentCulture)); - _sql.Bind_DateTime(this, _flags, index, (obj is string) ? + // _sql.Bind_DateTime(this, index, Convert.ToDateTime(obj, CultureInfo.CurrentCulture)); + _sql.Bind_DateTime(this, index, (obj is string) ? _sql.ToDateTime((string)obj) : Convert.ToDateTime(obj, CultureInfo.CurrentCulture)); break; - case DbType.Boolean: - _sql.Bind_Int32(this, _flags, index, ToBoolean(obj, CultureInfo.CurrentCulture) ? 1 : 0); - break; - case DbType.SByte: - _sql.Bind_Int32(this, _flags, index, Convert.ToSByte(obj, CultureInfo.CurrentCulture)); - break; - case DbType.Int16: - _sql.Bind_Int32(this, _flags, index, Convert.ToInt16(obj, CultureInfo.CurrentCulture)); - break; - case DbType.Int32: - _sql.Bind_Int32(this, _flags, index, Convert.ToInt32(obj, CultureInfo.CurrentCulture)); - break; - case DbType.Int64: - _sql.Bind_Int64(this, _flags, index, Convert.ToInt64(obj, CultureInfo.CurrentCulture)); - break; - case DbType.Byte: - _sql.Bind_UInt32(this, _flags, index, Convert.ToByte(obj, CultureInfo.CurrentCulture)); - break; - case DbType.UInt16: - _sql.Bind_UInt32(this, _flags, index, Convert.ToUInt16(obj, CultureInfo.CurrentCulture)); - break; - case DbType.UInt32: - _sql.Bind_UInt32(this, _flags, index, Convert.ToUInt32(obj, CultureInfo.CurrentCulture)); - break; - case DbType.UInt64: - _sql.Bind_UInt64(this, _flags, index, Convert.ToUInt64(obj, CultureInfo.CurrentCulture)); + case DbType.Boolean: + _sql.Bind_Int32(this, index, ToBoolean(obj, CultureInfo.CurrentCulture) ? 1 : 0); + break; + case DbType.SByte: + _sql.Bind_Int32(this, index, Convert.ToSByte(obj, CultureInfo.CurrentCulture)); + break; + case DbType.Int16: + _sql.Bind_Int32(this, index, Convert.ToInt16(obj, CultureInfo.CurrentCulture)); + break; + case DbType.Int32: + _sql.Bind_Int32(this, index, Convert.ToInt32(obj, CultureInfo.CurrentCulture)); + break; + case DbType.Int64: + _sql.Bind_Int64(this, index, Convert.ToInt64(obj, CultureInfo.CurrentCulture)); + break; + case DbType.Byte: + _sql.Bind_UInt32(this, index, Convert.ToByte(obj, CultureInfo.CurrentCulture)); + break; + case DbType.UInt16: + _sql.Bind_UInt32(this, index, Convert.ToUInt16(obj, CultureInfo.CurrentCulture)); + break; + case DbType.UInt32: + _sql.Bind_UInt32(this, index, Convert.ToUInt32(obj, CultureInfo.CurrentCulture)); + break; + case DbType.UInt64: + _sql.Bind_UInt64(this, index, Convert.ToUInt64(obj, CultureInfo.CurrentCulture)); break; case DbType.Single: case DbType.Double: case DbType.Currency: - //case DbType.Decimal: // Dont store decimal as double ... loses precision - _sql.Bind_Double(this, _flags, index, Convert.ToDouble(obj, CultureInfo.CurrentCulture)); + //case DbType.Decimal: // Dont store decimal as double ... loses precision + _sql.Bind_Double(this, index, Convert.ToDouble(obj, CultureInfo.CurrentCulture)); break; - case DbType.Binary: - _sql.Bind_Blob(this, _flags, index, (byte[])obj); + case DbType.Binary: + _sql.Bind_Blob(this, index, (byte[])obj); break; case DbType.Guid: - if (_command.Connection._binaryGuid == true) - _sql.Bind_Blob(this, _flags, index, ((Guid)obj).ToByteArray()); - else - _sql.Bind_Text(this, _flags, index, obj.ToString()); + if (_command.Connection._binaryGuid == true) + _sql.Bind_Blob(this, index, ((Guid)obj).ToByteArray()); + else + _sql.Bind_Text(this, index, obj.ToString()); break; - case DbType.Decimal: // Dont store decimal as double ... loses precision - _sql.Bind_Text(this, _flags, index, Convert.ToDecimal(obj, CultureInfo.CurrentCulture).ToString(CultureInfo.InvariantCulture)); + case DbType.Decimal: // Dont store decimal as double ... loses precision + _sql.Bind_Text(this, index, Convert.ToDecimal(obj, CultureInfo.CurrentCulture).ToString(CultureInfo.InvariantCulture)); break; - default: - _sql.Bind_Text(this, _flags, index, obj.ToString()); + default: + _sql.Bind_Text(this, index, obj.ToString()); break; } } internal string[] TypeDefinitions Index: System.Data.SQLite/SQLiteTransaction.cs ================================================================== --- System.Data.SQLite/SQLiteTransaction.cs +++ System.Data.SQLite/SQLiteTransaction.cs @@ -88,11 +88,11 @@ // dispose managed resources here... //////////////////////////////////// if (IsValid(false)) { - IssueRollback(false); + IssueRollback(); } } ////////////////////////////////////// // release unmanaged resources here... @@ -159,31 +159,23 @@ /// public override void Rollback() { CheckDisposed(); IsValid(true); - IssueRollback(true); - } - - internal void IssueRollback(bool throwError) + IssueRollback(); + } + + internal void IssueRollback() { SQLiteConnection cnn = Interlocked.Exchange(ref _cnn, null); if (cnn != null) - { - try - { - using (SQLiteCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "ROLLBACK"; - cmd.ExecuteNonQuery(); - } - } - catch - { - if (throwError) - throw; + { + using (SQLiteCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "ROLLBACK"; + cmd.ExecuteNonQuery(); } cnn._transactionLevel = 0; } } Index: System.Data.SQLite/SR.Designer.cs ================================================================== --- System.Data.SQLite/SR.Designer.cs +++ System.Data.SQLite/SR.Designer.cs @@ -23,13 +23,11 @@ // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] -#if !NET_COMPACT_20 [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] -#endif internal class SR { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; Index: System.Data.SQLite/SR.resx ================================================================== --- System.Data.SQLite/SR.resx +++ System.Data.SQLite/SR.resx @@ -110,21 +110,21 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + - DataTypes.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + DataTypes.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 ALL,ALTER,AND,AS,AUTOINCREMENT,BETWEEN,BY,CASE,CHECK,COLLATE,COMMIT,CONSTRAINT,CREATE,CROSS,DEFAULT,DEFERRABLE,DELETE,DISTINCT,DROP,ELSE,ESCAPE,EXCEPT,FOREIGN,FROM,FULL,GROUP,HAVING,IN,INDEX,INNER,INSERT,INTERSECT,INTO,IS,ISNULL,JOIN,LEFT,LIMIT,NATURAL,NOT,NOTNULL,NULL,ON,OR,ORDER,OUTER,PRIMARY,REFERENCES,RIGHT,ROLLBACK,SELECT,SET,TABLE,THEN,TO,TRANSACTION,UNION,UNIQUE,UPDATE,USING,VALUES,WHEN,WHERE - MetaDataCollections.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + MetaDataCollections.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 DELETED System.Data.SQLite/System.Data.SQLite.2005.csproj Index: System.Data.SQLite/System.Data.SQLite.2005.csproj ================================================================== --- System.Data.SQLite/System.Data.SQLite.2005.csproj +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {AC139952-261A-4463-B6FA-AEBC25283A66} - Library - Properties - System.Data.SQLite - System.Data.SQLite - $(MSBuildProjectDirectory)\.. - true - 2005 - - - - $(BinaryOutputPath) - $(BinaryOutputPath)System.Data.SQLite.xml - - - true - full - false - DEBUG;TRACE - prompt - - - pdbonly - true - TRACE - prompt - - - - - - - DELETED System.Data.SQLite/System.Data.SQLite.Compact.2005.csproj Index: System.Data.SQLite/System.Data.SQLite.Compact.2005.csproj ================================================================== --- System.Data.SQLite/System.Data.SQLite.Compact.2005.csproj +++ /dev/null @@ -1,73 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {AC139951-261A-4463-B6FA-AEBC25283A66} - Library - Properties - System.Data.SQLite - System.Data.SQLite - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - WindowsCE - E2BECB1F-8C8C-41ba-B736-9BE7D946A398 - 5.0 - v2.0 - Windows CE - - $(MSBuildProjectDirectory)\.. - true - false - false - true - 2005 - Compact - - - - $(BinaryOutputPath) - $(BinaryOutputPath)System.Data.SQLite.xml - - - true - full - false - DEBUG;TRACE;$(PlatformFamilyName) - true - true - prompt - off - - - pdbonly - true - TRACE;$(PlatformFamilyName) - true - true - prompt - off - - - - - - - - - - - - - - - Index: System.Data.SQLite/System.Data.SQLite.Files.targets ================================================================== --- System.Data.SQLite/System.Data.SQLite.Files.targets +++ System.Data.SQLite/System.Data.SQLite.Files.targets @@ -15,11 +15,10 @@ - Component @@ -33,11 +32,10 @@ Component - DELETED System.Data.SQLite/System.Data.SQLite.Module.2005.csproj Index: System.Data.SQLite/System.Data.SQLite.Module.2005.csproj ================================================================== --- System.Data.SQLite/System.Data.SQLite.Module.2005.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {AC139952-261A-4463-B6FA-AEBC25284A66} - Module - Properties - System.Data.SQLite - System.Data.SQLite - false - $(MSBuildProjectDirectory)\.. - true - 2005 - Module - false - false - - - - $(BinaryOutputPath) - $(BinaryOutputPath)System.Data.SQLite.xml - - - true - full - false - DEBUG;TRACE - prompt - - - pdbonly - true - TRACE - prompt - - - - - - - Index: System.Data.SQLite/System.Data.SQLite.Properties.targets ================================================================== --- System.Data.SQLite/System.Data.SQLite.Properties.targets +++ System.Data.SQLite/System.Data.SQLite.Properties.targets @@ -18,22 +18,10 @@ '$(TargetFrameworkVersion)' == 'v2.0' Or '$(TargetFrameworkVersion)' == 'v3.5'"> $(DefineConstants);NET_20 - - - $(DefineConstants);NET_COMPACT_20 - - @@ -67,29 +55,6 @@ NOTE: Throw an exception when somebody tries to access a disposed object? --> $(DefineConstants);THROW_ON_DISPOSED - - - - $(DefineConstants);PRELOAD_NATIVE_LIBRARY - - - - - $(DefineConstants);INTEROP_EXTENSION_FUNCTIONS - - - - - $(DefineConstants);INTEROP_CODEC - Index: System.Data.SQLite/UnsafeNativeMethods.cs ================================================================== --- System.Data.SQLite/UnsafeNativeMethods.cs +++ System.Data.SQLite/UnsafeNativeMethods.cs @@ -6,479 +6,33 @@ ********************************************************/ namespace System.Data.SQLite { using System; -#if PRELOAD_NATIVE_LIBRARY || DEBUG +#if DEBUG using System.Diagnostics; #endif -#if PRELOAD_NATIVE_LIBRARY - using System.Collections.Generic; - using System.IO; - using System.Reflection; -#endif - #if !PLATFORM_COMPACTFRAMEWORK && !DEBUG using System.Security; #endif using System.Runtime.InteropServices; -#if !PLATFORM_COMPACTFRAMEWORK - using System.Threading; -#endif - #if !PLATFORM_COMPACTFRAMEWORK && !DEBUG [SuppressUnmanagedCodeSecurity] #endif internal static class UnsafeNativeMethods { - #region Optional Native SQLite Library Pre-Loading Code - // - // NOTE: If we are looking for the standard SQLite DLL ("sqlite3.dll"), - // the interop DLL ("SQLite.Interop.dll"), or we are running on the - // .NET Compact Framework, we should include this code (only if the - // feature has actually been enabled). This code would be totally - // redundant if this module has been bundled into the mixed-mode - // assembly. - // -#if SQLITE_STANDARD || USE_INTEROP_DLL || PLATFORM_COMPACTFRAMEWORK - - // - // NOTE: Only compile in the native library pre-load code if the feature - // has been enabled for this build. - // -#if PRELOAD_NATIVE_LIBRARY -#if !PLATFORM_COMPACTFRAMEWORK - /// - /// The name of the environment variable containing the processor - /// architecture of the current process. - /// - private static readonly string PROCESSOR_ARCHITECTURE = - "PROCESSOR_ARCHITECTURE"; -#endif - - ///////////////////////////////////////////////////////////////////////// - - private static readonly string DllFileExtension = ".dll"; - - ///////////////////////////////////////////////////////////////////////// - /// - /// This is the P/Invoke method that wraps the native Win32 LoadLibrary - /// function. See the MSDN documentation for full details on what it - /// does. - /// - /// - /// The name of the executable library. - /// - /// - /// The native module handle upon success -OR- IntPtr.Zero on failure. - /// - [DllImport("kernel32", - CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Auto, -#if !PLATFORM_COMPACTFRAMEWORK - BestFitMapping = false, ThrowOnUnmappableChar = true, -#endif - SetLastError = true)] - private static extern IntPtr LoadLibrary(string fileName); - - /// - /// This lock is used to protect the static _SQLiteModule and - /// processorArchitecturePlatforms fields, below. - /// - private static readonly object staticSyncRoot = new object(); - - ///////////////////////////////////////////////////////////////////////// - /// - /// Stores the mappings between processor architecture names and platform - /// names. - /// - private static Dictionary processorArchitecturePlatforms; - - ///////////////////////////////////////////////////////////////////////// - /// - /// The native module handle for the native SQLite library or the value - /// IntPtr.Zero. - /// - private static IntPtr _SQLiteModule = IntPtr.Zero; - - ///////////////////////////////////////////////////////////////////////// - /// - /// For now, this method simply calls the Initialize method. - /// - static UnsafeNativeMethods() - { - Initialize(); - } - - ///////////////////////////////////////////////////////////////////////// - /// - /// Attempts to initialize this class by pre-loading the native SQLite - /// library for the processor architecture of the current process. - /// - internal static void Initialize() - { -#if !PLATFORM_COMPACTFRAMEWORK - // - // NOTE: If the "NoPreLoadSQLite" environment variable is set, skip - // all our special code and simply return. - // - if (Environment.GetEnvironmentVariable("No_PreLoadSQLite") != null) - return; -#endif - - lock (staticSyncRoot) - { - // - // TODO: Make sure this list is updated if the supported - // processor architecture names and/or platform names - // changes. - // - if (processorArchitecturePlatforms == null) - { - // - // NOTE: Create the map of processor architecture names - // to platform names using a case-insensitive string - // comparer. - // - processorArchitecturePlatforms = - new Dictionary( - StringComparer.OrdinalIgnoreCase); - - // - // NOTE: Setup the list of platform names associated with - // the supported processor architectures. - // - processorArchitecturePlatforms.Add("x86", "Win32"); - processorArchitecturePlatforms.Add("AMD64", "x64"); - processorArchitecturePlatforms.Add("IA64", "Itanium"); - } - - // - // BUGBUG: What about other application domains? - // - if (_SQLiteModule == IntPtr.Zero) - _SQLiteModule = PreLoadSQLiteDll(null, null); - } - } - - ///////////////////////////////////////////////////////////////////////// - /// - /// Queries and returns the base directory of the current application - /// domain. - /// - /// - /// The base directory for the current application domain -OR- null if it - /// cannot be determined. - /// - private static string GetBaseDirectory() - { -#if !PLATFORM_COMPACTFRAMEWORK - // - // NOTE: If the "PreLoadSQLite_BaseDirectory" environment variable - // is set, use it verbatim for the base directory. - // - string directory = Environment.GetEnvironmentVariable( - "PreLoadSQLite_BaseDirectory"); - - if (directory != null) - return directory; - - // - // NOTE: Otherwise, fallback on using the base directory of the - // current application domain. - // - return AppDomain.CurrentDomain.BaseDirectory; -#else - Assembly assembly = Assembly.GetExecutingAssembly(); - - if (assembly == null) - return null; - - AssemblyName assemblyName = assembly.GetName(); - - if (assemblyName == null) - return null; - - try - { - return Path.GetDirectoryName(assemblyName.CodeBase); - } - catch - { - // do nothing. - } - - return null; -#endif - } - - ///////////////////////////////////////////////////////////////////////// - /// - /// Determines if the dynamic link library file name requires a suffix - /// and adds it if necessary. - /// - /// - /// The original dynamic link library file name to inspect. - /// - /// - /// The dynamic link library file name, possibly modified to include an - /// extension. - /// - private static string FixUpDllFileName( - string fileName - ) - { - if (!String.IsNullOrEmpty(fileName)) - { - PlatformID platformId = Environment.OSVersion.Platform; - - if ((platformId == PlatformID.Win32S) || - (platformId == PlatformID.Win32Windows) || - (platformId == PlatformID.Win32NT) || - (platformId == PlatformID.WinCE)) - { - if (!fileName.EndsWith(DllFileExtension, - StringComparison.OrdinalIgnoreCase)) - { - return fileName + DllFileExtension; - } - } - } - - return fileName; - } - - ///////////////////////////////////////////////////////////////////////// - /// - /// Queries and returns the processor architecture of the current - /// process. - /// - /// - /// The processor architecture of the current process -OR- null if it - /// cannot be determined. Always returns an empty string when running on - /// the .NET Compact Framework. - /// - private static string GetProcessorArchitecture() - { -#if !PLATFORM_COMPACTFRAMEWORK - // - // NOTE: If the "PreLoadSQLite_ProcessorArchitecture" environment - // variable is set, use it verbatim for the current processor - // architecture. - // - string processorArchitecture = Environment.GetEnvironmentVariable( - "PreLoadSQLite_ProcessorArchitecture"); - - if (processorArchitecture != null) - return processorArchitecture; - - // - // BUGBUG: Will this always be reliable? - // - return Environment.GetEnvironmentVariable(PROCESSOR_ARCHITECTURE); -#else - // - // BUGBUG: No way to determine this value on the .NET Compact - // Framework (running on Windows CE, etc). - // - return String.Empty; -#endif - } - - ///////////////////////////////////////////////////////////////////////// - /// - /// Given the processor architecture, returns the name of the platform. - /// - /// - /// The processor architecture to be translated to a platform name. - /// - /// - /// The platform name for the specified processor architecture -OR- null - /// if it cannot be determined. - /// - private static string GetPlatformName( - string processorArchitecture - ) - { - if (String.IsNullOrEmpty(processorArchitecture)) - return null; - - lock (staticSyncRoot) - { - if (processorArchitecturePlatforms == null) - return null; - - string platformName; - - if (processorArchitecturePlatforms.TryGetValue( - processorArchitecture, out platformName)) - { - return platformName; - } - } - - return null; - } - - ///////////////////////////////////////////////////////////////////////// - /// - /// Attempts to load the native SQLite library based on the specified - /// directory and processor architecture. - /// - /// - /// The base directory to use, null for default (the base directory of - /// the current application domain). This directory should contain the - /// processor architecture specific sub-directories. - /// - /// - /// The requested processor architecture, null for default (the - /// processor architecture of the current process). This caller should - /// almost always specify null for this parameter. - /// - /// - /// The native module handle as returned by LoadLibrary -OR- IntPtr.Zero - /// if the loading fails for any reason. - /// - private static IntPtr PreLoadSQLiteDll( - string directory, - string processorArchitecture - ) - { - // - // NOTE: If the specified base directory is null, use the default. - // - if (directory == null) - directory = GetBaseDirectory(); - - // - // NOTE: If we failed to query the base directory, stop now. - // - if (directory == null) - return IntPtr.Zero; - - // - // NOTE: If the native SQLite library exists in the base directory - // itself, stop now. - // - string fileName = FixUpDllFileName(Path.Combine(directory, - SQLITE_DLL)); - - if (File.Exists(fileName)) - return IntPtr.Zero; - - // - // NOTE: If the specified processor architecture is null, use the - // default. - // - if (processorArchitecture == null) - processorArchitecture = GetProcessorArchitecture(); - - // - // NOTE: If we failed to query the processor architecture, stop now. - // - if (processorArchitecture == null) - return IntPtr.Zero; - - // - // NOTE: Build the full path and file name for the native SQLite - // library using the processor architecture name. - // - fileName = FixUpDllFileName(Path.Combine(Path.Combine(directory, - processorArchitecture), SQLITE_DLL)); - - // - // NOTE: If the file name based on the processor architecture name - // is not found, try using the associated platform name. - // - if (!File.Exists(fileName)) - { - // - // NOTE: Attempt to translate the processor architecture to a - // platform name. - // - string platformName = GetPlatformName(processorArchitecture); - - // - // NOTE: If we failed to translate the platform name, stop now. - // - if (platformName == null) - return IntPtr.Zero; - - // - // NOTE: Build the full path and file name for the native SQLite - // library using the platform name. - // - fileName = FixUpDllFileName(Path.Combine(Path.Combine(directory, - platformName), SQLITE_DLL)); - - // - // NOTE: If the file does not exist, skip trying to load it. - // - if (!File.Exists(fileName)) - return IntPtr.Zero; - } - - try - { - // - // NOTE: Show exactly where we are trying to load the native - // SQLite library from. - // - Trace.WriteLine(String.Format( - "Trying to load native SQLite library \"{0}\"...", - fileName)); - - // - // NOTE: Attempt to load the native library. This will either - // return a valid native module handle, return IntPtr.Zero, - // or throw an exception. - // - return LoadLibrary(fileName); - } - catch (Exception e) - { - try - { - // - // NOTE: First, grab the last Win32 error number. - // - int lastError = Marshal.GetLastWin32Error(); - - // - // NOTE: Show where we failed to load the native SQLite - // library from along with the Win32 error code and - // exception information. - // - Trace.WriteLine(String.Format( - "Failed to load native SQLite library \"{0}\" " + - "(getLastError = {1}): {2}", - fileName, lastError, e)); /* throw */ - } - catch - { - // do nothing. - } - } - - return IntPtr.Zero; - } -#endif -#endif - #endregion - - ///////////////////////////////////////////////////////////////////////// - #if !SQLITE_STANDARD #if !USE_INTEROP_DLL #if !PLATFORM_COMPACTFRAMEWORK private const string SQLITE_DLL = "System.Data.SQLite.dll"; #else - internal const string SQLITE_DLL = "SQLite.Interop.081.dll"; + internal const string SQLITE_DLL = "SQLite.Interop.078.dll"; #endif // PLATFORM_COMPACTFRAMEWORK #else private const string SQLITE_DLL = "SQLite.Interop.dll"; #endif // USE_INTEROP_DLL @@ -1130,11 +684,10 @@ #else [DllImport(SQLITE_DLL, CharSet = CharSet.Unicode)] #endif internal static extern void sqlite3_result_text16(IntPtr context, string strName, int nLen, IntPtr pvReserved); -#if INTEROP_CODEC #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif @@ -1144,11 +697,10 @@ [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] #endif internal static extern int sqlite3_rekey(IntPtr db, byte[] key, int keylen); -#endif #if !PLATFORM_COMPACTFRAMEWORK [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] #else [DllImport(SQLITE_DLL)] @@ -1249,44 +801,10 @@ #else [DllImport(SQLITE_DLL)] #endif internal static extern int sqlite3_file_control(IntPtr db, byte[] zDbName, int op, IntPtr pArg); -#if !PLATFORM_COMPACTFRAMEWORK - [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] -#else - [DllImport(SQLITE_DLL)] -#endif - internal static extern IntPtr sqlite3_backup_init(IntPtr destDb, byte[] zDestName, IntPtr sourceDb, byte[] zSourceName); - -#if !PLATFORM_COMPACTFRAMEWORK - [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] -#else - [DllImport(SQLITE_DLL)] -#endif - internal static extern int sqlite3_backup_step(IntPtr backup, int nPage); - -#if !PLATFORM_COMPACTFRAMEWORK - [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] -#else - [DllImport(SQLITE_DLL)] -#endif - internal static extern int sqlite3_backup_finish(IntPtr backup); - -#if !PLATFORM_COMPACTFRAMEWORK - [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] -#else - [DllImport(SQLITE_DLL)] -#endif - internal static extern int sqlite3_backup_remaining(IntPtr backup); - -#if !PLATFORM_COMPACTFRAMEWORK - [DllImport(SQLITE_DLL, CallingConvention = CallingConvention.Cdecl)] -#else - [DllImport(SQLITE_DLL)] -#endif - internal static extern int sqlite3_backup_pagecount(IntPtr backup); #endregion } #if PLATFORM_COMPACTFRAMEWORK internal abstract class CriticalHandle : IDisposable @@ -1363,64 +881,57 @@ // Handles the unmanaged database pointer, and provides finalization support for it. internal class SQLiteConnectionHandle : CriticalHandle { public static implicit operator IntPtr(SQLiteConnectionHandle db) { - return (db != null) ? db.handle : IntPtr.Zero; + return db.handle; + } + + public static implicit operator SQLiteConnectionHandle(IntPtr db) + { + return new SQLiteConnectionHandle(db); } - internal SQLiteConnectionHandle(IntPtr db) + private SQLiteConnectionHandle(IntPtr db) : this() { SetHandle(db); } - private SQLiteConnectionHandle() + internal SQLiteConnectionHandle() : base(IntPtr.Zero) { } protected override bool ReleaseHandle() { try { -#if !PLATFORM_COMPACTFRAMEWORK - IntPtr localHandle = Interlocked.Exchange( - ref handle, IntPtr.Zero); - - if (localHandle != IntPtr.Zero) - SQLiteBase.CloseConnection(this, localHandle); - -#if DEBUG && !NET_COMPACT_20 + SQLiteBase.CloseConnection(this); + +#if DEBUG try { Trace.WriteLine(String.Format( - "CloseConnection: {0}", localHandle)); + "CloseConnection: {0}", handle)); } catch { } #endif -#else - if (handle != IntPtr.Zero) - { - SQLiteBase.CloseConnection(this, handle); - SetHandle(IntPtr.Zero); - } -#endif #if DEBUG return true; #endif } -#if DEBUG && !NET_COMPACT_20 +#if DEBUG catch (SQLiteException e) #else catch (SQLiteException) #endif { -#if DEBUG && !NET_COMPACT_20 +#if DEBUG try { Trace.WriteLine(String.Format( "CloseConnection: {0}, exception: {1}", handle, e)); @@ -1428,14 +939,10 @@ catch { } #endif } - finally - { - SetHandleAsInvalid(); - } #if DEBUG return false; #else return true; #endif @@ -1443,81 +950,64 @@ public override bool IsInvalid { get { return (handle == IntPtr.Zero); } } - -#if DEBUG - public override string ToString() - { - return handle.ToString(); - } -#endif } // Provides finalization support for unmanaged SQLite statements. internal class SQLiteStatementHandle : CriticalHandle { - private SQLiteConnectionHandle cnn; - public static implicit operator IntPtr(SQLiteStatementHandle stmt) { - return (stmt != null) ? stmt.handle : IntPtr.Zero; + return stmt.handle; + } + + public static implicit operator SQLiteStatementHandle(IntPtr stmt) + { + return new SQLiteStatementHandle(stmt); } - internal SQLiteStatementHandle(SQLiteConnectionHandle cnn, IntPtr stmt) + private SQLiteStatementHandle(IntPtr stmt) : this() { - this.cnn = cnn; SetHandle(stmt); } - private SQLiteStatementHandle() + internal SQLiteStatementHandle() : base(IntPtr.Zero) { } protected override bool ReleaseHandle() { try { -#if !PLATFORM_COMPACTFRAMEWORK - IntPtr localHandle = Interlocked.Exchange( - ref handle, IntPtr.Zero); - - if (localHandle != IntPtr.Zero) - SQLiteBase.FinalizeStatement(cnn, localHandle); - -#if DEBUG && !NET_COMPACT_20 + SQLiteBase.FinalizeStatement(this); + +#if DEBUG try { Trace.WriteLine(String.Format( - "FinalizeStatement: {0}", localHandle)); + "FinalizeStatement: {0}", handle)); } catch { } #endif -#else - if (handle != IntPtr.Zero) - { - SQLiteBase.FinalizeStatement(cnn, handle); - SetHandle(IntPtr.Zero); - } -#endif #if DEBUG return true; #endif } -#if DEBUG && !NET_COMPACT_20 +#if DEBUG catch (SQLiteException e) #else catch (SQLiteException) #endif { -#if DEBUG && !NET_COMPACT_20 +#if DEBUG try { Trace.WriteLine(String.Format( "FinalizeStatement: {0}, exception: {1}", handle, e)); @@ -1525,14 +1015,10 @@ catch { } #endif } - finally - { - SetHandleAsInvalid(); - } #if DEBUG return false; #else return true; #endif @@ -1540,111 +1026,7 @@ public override bool IsInvalid { get { return (handle == IntPtr.Zero); } } - -#if DEBUG - public override string ToString() - { - return handle.ToString(); - } -#endif - } - - // Provides finalization support for unmanaged SQLite backup objects. - internal class SQLiteBackupHandle : CriticalHandle - { - private SQLiteConnectionHandle cnn; - - public static implicit operator IntPtr(SQLiteBackupHandle backup) - { - return (backup != null) ? backup.handle : IntPtr.Zero; - } - - internal SQLiteBackupHandle(SQLiteConnectionHandle cnn, IntPtr backup) - : this() - { - this.cnn = cnn; - SetHandle(backup); - } - - private SQLiteBackupHandle() - : base(IntPtr.Zero) - { - } - - protected override bool ReleaseHandle() - { - try - { -#if !PLATFORM_COMPACTFRAMEWORK - IntPtr localHandle = Interlocked.Exchange( - ref handle, IntPtr.Zero); - - if (localHandle != IntPtr.Zero) - SQLiteBase.FinishBackup(cnn, localHandle); - -#if DEBUG && !NET_COMPACT_20 - try - { - Trace.WriteLine(String.Format( - "FinishBackup: {0}", localHandle)); - } - catch - { - } -#endif -#else - if (handle != IntPtr.Zero) - { - SQLiteBase.FinishBackup(cnn, handle); - SetHandle(IntPtr.Zero); - } -#endif - -#if DEBUG - return true; -#endif - } -#if DEBUG && !NET_COMPACT_20 - catch (SQLiteException e) -#else - catch (SQLiteException) -#endif - { -#if DEBUG && !NET_COMPACT_20 - try - { - Trace.WriteLine(String.Format( - "FinishBackup: {0}, exception: {1}", - handle, e)); - } - catch - { - } -#endif - } - finally - { - SetHandleAsInvalid(); - } -#if DEBUG - return false; -#else - return true; -#endif - } - - public override bool IsInvalid - { - get { return (handle == IntPtr.Zero); } - } - -#if DEBUG - public override string ToString() - { - return handle.ToString(); - } -#endif } } DELETED Tests/Installer_Test_Vs2005.log Index: Tests/Installer_Test_Vs2005.log ================================================================== --- Tests/Installer_Test_Vs2005.log +++ /dev/null @@ -1,64 +0,0 @@ -Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. -Installer.exe: #2: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" -Installer.exe: #3: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" -Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727", writable = False -Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True -Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "SQLite" -Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True -Installer.exe: #10: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" -Installer.exe: #11: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\System.Data.SQLite", name = , value = "[file nativename [getBuildDirectory]]" -Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727", writable = False -Installer.exe: #13: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #14: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #17: Installer.RemoveDbProviderFactory: addElement = , removeElement = -Installer.exe: #18: Installer.AddDbProviderFactory: addElement = -Installer.exe: #19: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #20: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", name = "InstallDir", defaultValue = -Installer.exe: #21: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "Packages", writable = True -Installer.exe: #23: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #24: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = , value = "System.Data.SQLite Designer Package" -Installer.exe: #25: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "Class", value = "SQLite.Designer.SQLitePackage" -Installer.exe: #26: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" -Installer.exe: #27: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ID", value = 400 -Installer.exe: #28: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "InprocServer32", value = "[file nativename [file join $::env(windir) system32 mscoree.dll]]" -Installer.exe: #29: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CompanyName", value = "http://system.data.sqlite.org/" -Installer.exe: #30: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "MinEdition", value = "standard" -Installer.exe: #31: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductName", value = "System.Data.SQLite Designer Package" -Installer.exe: #32: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductVersion", value = "1.0" -Installer.exe: #33: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", subKeyName = "Toolbox" -Installer.exe: #34: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages\Toolbox", name = "Default Items", value = 3 -Installer.exe: #35: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "Menus", writable = True -Installer.exe: #36: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", value = ", 1000, 3" -Installer.exe: #37: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "Services", writable = True -Installer.exe: #38: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" -Installer.exe: #39: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = , value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #40: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = "Name", value = "System.Data.SQLite Designer Service" -Installer.exe: #41: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #42: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", name = "InstallDir", defaultValue = -Installer.exe: #43: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #44: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "DataSources", writable = True -Installer.exe: #45: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" -Installer.exe: #46: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", name = , value = "System.Data.SQLite Database File" -Installer.exe: #47: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", subKeyName = "SupportingProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" -Installer.exe: #48: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #49: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", name = "InstallDir", defaultValue = -Installer.exe: #50: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #51: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "DataProviders", writable = True -Installer.exe: #52: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" -Installer.exe: #53: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = , value = ".NET Framework Data Provider for SQLite" -Installer.exe: #54: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "InvariantName", value = "System.Data.SQLite" -Installer.exe: #55: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "Technology", value = "{77ab9a9d-78b9-4ba7-91ac-873f5338f1d2}" -Installer.exe: #56: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" -Installer.exe: #57: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "FactoryService", value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" -Installer.exe: #58: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionUIControl" -Installer.exe: #59: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionProperties" -Installer.exe: #60: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionSupport" -Installer.exe: #61: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataObjectSupport" -Installer.exe: #62: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataViewSupport" -Installer.exe: #63: Installer.Main: subKeysCreated = 12, subKeysDeleted = 1, keyValuesSet = 20, keyValuesDeleted = 0 -Installer.exe: #64: Installer.Main: Success. Index: Tests/Installer_Test_Vs2008.log ================================================================== --- Tests/Installer_Test_Vs2008.log +++ Tests/Installer_Test_Vs2008.log @@ -1,64 +1,64 @@ Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" Installer.exe: #3: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" -Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727", writable = False -Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True -Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "SQLite" -Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True -Installer.exe: #10: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" -Installer.exe: #11: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\System.Data.SQLite", name = , value = "[file nativename [getBuildDirectory]]" -Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727", writable = False -Installer.exe: #13: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #14: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #17: Installer.RemoveDbProviderFactory: addElement = , removeElement = -Installer.exe: #18: Installer.AddDbProviderFactory: addElement = -Installer.exe: #19: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #20: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = -Installer.exe: #21: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "Packages", writable = True -Installer.exe: #23: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #24: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = , value = "System.Data.SQLite Designer Package" -Installer.exe: #25: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "Class", value = "SQLite.Designer.SQLitePackage" -Installer.exe: #26: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" -Installer.exe: #27: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ID", value = 400 -Installer.exe: #28: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "InprocServer32", value = "[file nativename [file join $::env(windir) system32 mscoree.dll]]" -Installer.exe: #29: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CompanyName", value = "http://system.data.sqlite.org/" -Installer.exe: #30: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "MinEdition", value = "standard" -Installer.exe: #31: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductName", value = "System.Data.SQLite Designer Package" -Installer.exe: #32: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductVersion", value = "1.0" -Installer.exe: #33: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", subKeyName = "Toolbox" -Installer.exe: #34: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages\Toolbox", name = "Default Items", value = 3 -Installer.exe: #35: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "Menus", writable = True -Installer.exe: #36: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", value = ", 1000, 3" -Installer.exe: #37: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "Services", writable = True -Installer.exe: #38: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" -Installer.exe: #39: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = , value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #40: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = "Name", value = "System.Data.SQLite Designer Service" -Installer.exe: #41: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #42: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = -Installer.exe: #43: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #44: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "DataSources", writable = True -Installer.exe: #45: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" -Installer.exe: #46: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", name = , value = "System.Data.SQLite Database File" -Installer.exe: #47: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", subKeyName = "SupportingProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" -Installer.exe: #48: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #49: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = -Installer.exe: #50: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #51: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "DataProviders", writable = True -Installer.exe: #52: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" -Installer.exe: #53: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = , value = ".NET Framework Data Provider for SQLite" -Installer.exe: #54: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "InvariantName", value = "System.Data.SQLite" -Installer.exe: #55: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "Technology", value = "{77ab9a9d-78b9-4ba7-91ac-873f5338f1d2}" -Installer.exe: #56: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" -Installer.exe: #57: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "FactoryService", value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" -Installer.exe: #58: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionUIControl" -Installer.exe: #59: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionProperties" -Installer.exe: #60: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionSupport" -Installer.exe: #61: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataObjectSupport" -Installer.exe: #62: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataViewSupport" +Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727", writable = False +Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True +Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "SQLite" +Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True +Installer.exe: #10: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" +Installer.exe: #11: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\System.Data.SQLite", name = , value = "[file nativename [getBuildDirectory]]" +Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727", writable = False +Installer.exe: #13: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #14: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #17: Installer.RemoveDbProviderFactory: element = +Installer.exe: #18: Installer.AddDbProviderFactory: element = +Installer.exe: #19: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #20: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = +Installer.exe: #21: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Packages", writable = True +Installer.exe: #23: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" +Installer.exe: #24: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = , value = "System.Data.SQLite Designer Package" +Installer.exe: #25: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "Class", value = "SQLite.Designer.SQLitePackage" +Installer.exe: #26: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" +Installer.exe: #27: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ID", value = 400 +Installer.exe: #28: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "InprocServer32", value = "[file nativename [file join $::env(windir) system32 mscoree.dll]]" +Installer.exe: #29: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CompanyName", value = "http://system.data.sqlite.org/" +Installer.exe: #30: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "MinEdition", value = "standard" +Installer.exe: #31: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductName", value = "System.Data.SQLite Designer Package" +Installer.exe: #32: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductVersion", value = "1.0" +Installer.exe: #33: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", subKeyName = "Toolbox" +Installer.exe: #34: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages\Toolbox", name = "Default Items", value = 3 +Installer.exe: #35: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Menus", writable = True +Installer.exe: #36: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", value = ", 1000, 3" +Installer.exe: #37: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Services", writable = True +Installer.exe: #38: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" +Installer.exe: #39: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = , value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" +Installer.exe: #40: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = "Name", value = "System.Data.SQLite Designer Service" +Installer.exe: #41: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #42: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = +Installer.exe: #43: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #44: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "DataSources", writable = True +Installer.exe: #45: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" +Installer.exe: #46: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", name = , value = "System.Data.SQLite Database File" +Installer.exe: #47: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", subKeyName = "SupportingProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" +Installer.exe: #48: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #49: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = +Installer.exe: #50: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #51: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "DataProviders", writable = True +Installer.exe: #52: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" +Installer.exe: #53: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = , value = ".NET Framework Data Provider for SQLite" +Installer.exe: #54: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "InvariantName", value = "System.Data.SQLite" +Installer.exe: #55: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "Technology", value = "{77ab9a9d-78b9-4ba7-91ac-873f5338f1d2}" +Installer.exe: #56: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" +Installer.exe: #57: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "FactoryService", value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" +Installer.exe: #58: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionUIControl" +Installer.exe: #59: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionProperties" +Installer.exe: #60: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionSupport" +Installer.exe: #61: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataObjectSupport" +Installer.exe: #62: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataViewSupport" Installer.exe: #63: Installer.Main: subKeysCreated = 12, subKeysDeleted = 1, keyValuesSet = 20, keyValuesDeleted = 0 Installer.exe: #64: Installer.Main: Success. Index: Tests/Installer_Test_Vs2010.log ================================================================== --- Tests/Installer_Test_Vs2010.log +++ Tests/Installer_Test_Vs2010.log @@ -1,64 +1,64 @@ Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" Installer.exe: #3: Installer.Main: GacInstall: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" -Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v4.0.30319", writable = False -Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", writable = True -Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", subKeyName = "SQLite" -Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", writable = True -Installer.exe: #10: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" -Installer.exe: #11: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\System.Data.SQLite", name = , value = "[file nativename [getBuildDirectory]]" -Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v4.0.30319", writable = False -Installer.exe: #13: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #14: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #17: Installer.RemoveDbProviderFactory: addElement = , removeElement = -Installer.exe: #18: Installer.AddDbProviderFactory: addElement = -Installer.exe: #19: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #20: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = -Installer.exe: #21: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "Packages", writable = True -Installer.exe: #23: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #24: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = , value = "System.Data.SQLite Designer Package" -Installer.exe: #25: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "Class", value = "SQLite.Designer.SQLitePackage" -Installer.exe: #26: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" -Installer.exe: #27: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ID", value = 400 -Installer.exe: #28: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "InprocServer32", value = "[file nativename [file join $::env(windir) system32 mscoree.dll]]" -Installer.exe: #29: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CompanyName", value = "http://system.data.sqlite.org/" -Installer.exe: #30: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "MinEdition", value = "standard" -Installer.exe: #31: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductName", value = "System.Data.SQLite Designer Package" -Installer.exe: #32: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductVersion", value = "1.0" -Installer.exe: #33: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", subKeyName = "Toolbox" -Installer.exe: #34: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages\Toolbox", name = "Default Items", value = 3 -Installer.exe: #35: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "Menus", writable = True -Installer.exe: #36: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", value = ", 1000, 3" -Installer.exe: #37: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "Services", writable = True -Installer.exe: #38: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" -Installer.exe: #39: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = , value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #40: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = "Name", value = "System.Data.SQLite Designer Service" -Installer.exe: #41: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #42: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = -Installer.exe: #43: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #44: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "DataSources", writable = True -Installer.exe: #45: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" -Installer.exe: #46: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", name = , value = "System.Data.SQLite Database File" -Installer.exe: #47: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", subKeyName = "SupportingProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" -Installer.exe: #48: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #49: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = -Installer.exe: #50: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #51: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "DataProviders", writable = True -Installer.exe: #52: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" -Installer.exe: #53: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = , value = ".NET Framework Data Provider for SQLite" -Installer.exe: #54: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "InvariantName", value = "System.Data.SQLite" -Installer.exe: #55: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "Technology", value = "{77ab9a9d-78b9-4ba7-91ac-873f5338f1d2}" -Installer.exe: #56: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" -Installer.exe: #57: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "FactoryService", value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" -Installer.exe: #58: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionUIControl" -Installer.exe: #59: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionProperties" -Installer.exe: #60: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionSupport" -Installer.exe: #61: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataObjectSupport" -Installer.exe: #62: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataViewSupport" +Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319", writable = False +Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", writable = True +Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", subKeyName = "SQLite" +Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", writable = True +Installer.exe: #10: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" +Installer.exe: #11: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\System.Data.SQLite", name = , value = "[file nativename [getBuildDirectory]]" +Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319", writable = False +Installer.exe: #13: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #14: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #17: Installer.RemoveDbProviderFactory: element = +Installer.exe: #18: Installer.AddDbProviderFactory: element = +Installer.exe: #19: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #20: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = +Installer.exe: #21: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Packages", writable = True +Installer.exe: #23: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" +Installer.exe: #24: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = , value = "System.Data.SQLite Designer Package" +Installer.exe: #25: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "Class", value = "SQLite.Designer.SQLitePackage" +Installer.exe: #26: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" +Installer.exe: #27: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ID", value = 400 +Installer.exe: #28: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "InprocServer32", value = "[file nativename [file join $::env(windir) system32 mscoree.dll]]" +Installer.exe: #29: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "CompanyName", value = "http://system.data.sqlite.org/" +Installer.exe: #30: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "MinEdition", value = "standard" +Installer.exe: #31: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductName", value = "System.Data.SQLite Designer Package" +Installer.exe: #32: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", name = "ProductVersion", value = "1.0" +Installer.exe: #33: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", subKeyName = "Toolbox" +Installer.exe: #34: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages\Toolbox", name = "Default Items", value = 3 +Installer.exe: #35: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Menus", writable = True +Installer.exe: #36: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}", value = ", 1000, 3" +Installer.exe: #37: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Services", writable = True +Installer.exe: #38: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" +Installer.exe: #39: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = , value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" +Installer.exe: #40: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Services\{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}", name = "Name", value = "System.Data.SQLite Designer Service" +Installer.exe: #41: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #42: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = +Installer.exe: #43: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #44: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "DataSources", writable = True +Installer.exe: #45: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" +Installer.exe: #46: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", name = , value = "System.Data.SQLite Database File" +Installer.exe: #47: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataSources\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}", subKeyName = "SupportingProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" +Installer.exe: #48: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #49: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = +Installer.exe: #50: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #51: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "DataProviders", writable = True +Installer.exe: #52: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" +Installer.exe: #53: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = , value = ".NET Framework Data Provider for SQLite" +Installer.exe: #54: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "InvariantName", value = "System.Data.SQLite" +Installer.exe: #55: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "Technology", value = "{77ab9a9d-78b9-4ba7-91ac-873f5338f1d2}" +Installer.exe: #56: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "CodeBase", value = "[file nativename [file join [getBuildDirectory] SQLite.Designer.dll]]" +Installer.exe: #57: RegistryHelper.SetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", name = "FactoryService", value = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" +Installer.exe: #58: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionUIControl" +Installer.exe: #59: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionProperties" +Installer.exe: #60: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataConnectionSupport" +Installer.exe: #61: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataObjectSupport" +Installer.exe: #62: RegistryHelper.CreateSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}", subKeyName = "SupportedObjects\DataViewSupport" Installer.exe: #63: Installer.Main: subKeysCreated = 12, subKeysDeleted = 1, keyValuesSet = 20, keyValuesDeleted = 0 Installer.exe: #64: Installer.Main: Success. DELETED Tests/Uninstaller_Test_Vs2005.log Index: Tests/Uninstaller_Test_Vs2005.log ================================================================== --- Tests/Uninstaller_Test_Vs2005.log +++ /dev/null @@ -1,35 +0,0 @@ -Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. -Installer.exe: #2: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" -Installer.exe: #3: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" -Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727", writable = False -Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True -Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" -Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727", writable = False -Installer.exe: #10: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #11: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #13: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #14: Installer.RemoveDbProviderFactory: addElement = , removeElement = -Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", name = "InstallDir", defaultValue = -Installer.exe: #17: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #18: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "Packages", writable = True -Installer.exe: #19: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #20: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "Menus", writable = True -Installer.exe: #21: RegistryHelper.DeleteValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "Services", writable = True -Installer.exe: #23: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" -Installer.exe: #24: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #25: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", name = "InstallDir", defaultValue = -Installer.exe: #26: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #27: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "DataSources", writable = True -Installer.exe: #28: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" -Installer.exe: #29: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #30: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", name = "InstallDir", defaultValue = -Installer.exe: #31: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\8.0", writable = False -Installer.exe: #32: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0", subKeyName = "DataProviders", writable = True -Installer.exe: #33: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\8.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" -Installer.exe: #34: Installer.Main: subKeysCreated = 0, subKeysDeleted = 5, keyValuesSet = 0, keyValuesDeleted = 1 -Installer.exe: #35: Installer.Main: Success. Index: Tests/Uninstaller_Test_Vs2008.log ================================================================== --- Tests/Uninstaller_Test_Vs2008.log +++ Tests/Uninstaller_Test_Vs2008.log @@ -1,35 +1,35 @@ Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" Installer.exe: #3: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" -Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727", writable = False -Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True -Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" -Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v2.0.50727", writable = False -Installer.exe: #10: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #11: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #13: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #14: Installer.RemoveDbProviderFactory: addElement = , removeElement = -Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = -Installer.exe: #17: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #18: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "Packages", writable = True -Installer.exe: #19: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #20: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "Menus", writable = True -Installer.exe: #21: RegistryHelper.DeleteValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "Services", writable = True -Installer.exe: #23: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" -Installer.exe: #24: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #25: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = -Installer.exe: #26: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #27: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "DataSources", writable = True -Installer.exe: #28: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" -Installer.exe: #29: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #30: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = -Installer.exe: #31: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\9.0", writable = False -Installer.exe: #32: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0", subKeyName = "DataProviders", writable = True -Installer.exe: #33: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\9.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" +Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727", writable = False +Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", writable = True +Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" +Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v2.0.50727", writable = False +Installer.exe: #10: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #11: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #13: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #14: Installer.RemoveDbProviderFactory: element = +Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = +Installer.exe: #17: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #18: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Packages", writable = True +Installer.exe: #19: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" +Installer.exe: #20: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Menus", writable = True +Installer.exe: #21: RegistryHelper.DeleteValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" +Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "Services", writable = True +Installer.exe: #23: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" +Installer.exe: #24: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #25: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = +Installer.exe: #26: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #27: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "DataSources", writable = True +Installer.exe: #28: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" +Installer.exe: #29: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #30: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", name = "InstallDir", defaultValue = +Installer.exe: #31: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\9.0", writable = False +Installer.exe: #32: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0", subKeyName = "DataProviders", writable = True +Installer.exe: #33: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\9.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" Installer.exe: #34: Installer.Main: subKeysCreated = 0, subKeysDeleted = 5, keyValuesSet = 0, keyValuesDeleted = 1 Installer.exe: #35: Installer.Main: Success. Index: Tests/Uninstaller_Test_Vs2010.log ================================================================== --- Tests/Uninstaller_Test_Vs2010.log +++ Tests/Uninstaller_Test_Vs2010.log @@ -1,35 +1,35 @@ Installer.exe: #1: Configuration.Process: No actual changes will be made to this system because "what-if" mode is enabled. Installer.exe: #2: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.Linq.dll]]" Installer.exe: #3: Installer.Main: GacRemove: assemblyPath = "[file nativename [file join [getBuildDirectory] System.Data.SQLite.dll]]" -Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v4.0.30319", writable = False -Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", writable = True -Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" -Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework\v4.0.30319", writable = False -Installer.exe: #10: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #11: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\.NETFramework", writable = False -Installer.exe: #13: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = -Installer.exe: #14: Installer.RemoveDbProviderFactory: addElement = , removeElement = -Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = -Installer.exe: #17: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #18: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "Packages", writable = True -Installer.exe: #19: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #20: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "Menus", writable = True -Installer.exe: #21: RegistryHelper.DeleteValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" -Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "Services", writable = True -Installer.exe: #23: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" -Installer.exe: #24: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #25: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = -Installer.exe: #26: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #27: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "DataSources", writable = True -Installer.exe: #28: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" -Installer.exe: #29: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #30: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = -Installer.exe: #31: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software${wow64}\Microsoft\VisualStudio\10.0", writable = False -Installer.exe: #32: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0", subKeyName = "DataProviders", writable = True -Installer.exe: #33: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software${wow64}\Microsoft\VisualStudio\10.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" +Installer.exe: #4: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319", writable = False +Installer.exe: #5: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #6: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #7: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", writable = True +Installer.exe: #8: RegistryHelper.DeleteSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx", subKeyName = "System.Data.SQLite" +Installer.exe: #9: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework\v4.0.30319", writable = False +Installer.exe: #10: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #11: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #12: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\.NETFramework", writable = False +Installer.exe: #13: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework", name = "InstallRoot", defaultValue = +Installer.exe: #14: Installer.RemoveDbProviderFactory: element = +Installer.exe: #15: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #16: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = +Installer.exe: #17: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #18: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Packages", writable = True +Installer.exe: #19: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Packages", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" +Installer.exe: #20: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Menus", writable = True +Installer.exe: #21: RegistryHelper.DeleteValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Menus", name = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9c}" +Installer.exe: #22: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "Services", writable = True +Installer.exe: #23: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\Services", subKeyName = "{dcbe6c8d-0e57-4099-a183-98ff74c64d9d}" +Installer.exe: #24: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #25: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = +Installer.exe: #26: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #27: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "DataSources", writable = True +Installer.exe: #28: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataSources", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}" +Installer.exe: #29: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #30: RegistryHelper.GetValue: key = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", name = "InstallDir", defaultValue = +Installer.exe: #31: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE", subKeyName = "Software\Microsoft\VisualStudio\10.0", writable = False +Installer.exe: #32: RegistryHelper.OpenSubKey: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0", subKeyName = "DataProviders", writable = True +Installer.exe: #33: RegistryHelper.DeleteSubKeyTree: rootKey = "HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\10.0\DataProviders", subKeyName = "{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}" Installer.exe: #34: Installer.Main: subKeysCreated = 0, subKeysDeleted = 5, keyValuesSet = 0, keyValuesDeleted = 1 Installer.exe: #35: Installer.Main: Success. Index: Tests/all.eagle ================================================================== --- Tests/all.eagle +++ Tests/all.eagle @@ -12,12 +12,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### DELETED Tests/backup.eagle Index: Tests/backup.eagle ================================================================== --- Tests/backup.eagle +++ /dev/null @@ -1,231 +0,0 @@ -############################################################################### -# -# backup.eagle -- -# -# Written by Joe Mistachkin. -# Released to the public domain, use at your own risk! -# -############################################################################### - -package require Eagle -package require Eagle.Library -package require Eagle.Test - -runTestPrologue - -############################################################################### - -package require System.Data.SQLite.Test -runSQLiteTestPrologue - -############################################################################### - -set params(pages) [list -1 -1 0 0 1 1 2 2 1000 1000] - -set params(callbacks) [list null "new SQLiteBackupCallback(BackupCallback)" \ - null "new SQLiteBackupCallback(BackupCallback)" \ - null "new SQLiteBackupCallback(BackupCallback)" \ - null "new SQLiteBackupCallback(BackupCallback)" \ - null "new SQLiteBackupCallback(BackupCallback)"] - -set params(results) [list \ - "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\ - 1048576 1048576 10\\} 0\$" \ - "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\ - 1048576 1048576 10\\} 0\$" \ - "1 \\{System\\.Reflection\\.TargetInvocationException: Exception has been\ - thrown by the target of an invocation\\. --->\ - System\\.Data\\.SQLite\\.SQLiteException: SQLite error\\r\\nno such table:\ - t1\\r\\n.*?" \ - "1 \\{System\\.Reflection\\.TargetInvocationException: Exception has been\ - thrown by the target of an invocation\\. --->\ - System\\.Data\\.SQLite\\.SQLiteException: SQLite error\\r\\nno such table:\ - t1\\r\\n.*?" \ - "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\ - 1048576 1048576 10\\} 0\$" \ - "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\ - 1048576 1048576 10\\} 10283\$" \ - "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\ - 1048576 1048576 10\\} 0\$" \ - "1 \\{System\\.Reflection\\.TargetInvocationException: Exception has been\ - thrown by the target of an invocation\\. --->\ - System\\.Data\\.SQLite\\.SQLiteException: SQLite error\\r\\nno such table:\ - t1\\r\\n.*?" \ - "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\ - 1048576 1048576 10\\} \\{\\}\$" \ - "0 \\{1 1048576 1048576 1048576 1048576 1048576 1048576 1048576 1048576\ - 1048576 1048576 10\\} \\{System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 9284 10284 False\ - System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 8284 10284 False\ - System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 7284 10284 False\ - System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 6284 10284 False\ - System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 5284 10284 False\ - System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 4284 10284 False\ - System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 3284 10284 False\ - System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 2284 10284 False\ - System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 1284 10284 False\ - System\\.Data\\.SQLite\\.SQLiteConnection main\ - System\\.Data\\.SQLite\\.SQLiteConnection main 1000 284 10284 False\\}\$"] - -############################################################################### - -for {set i 0} {$i < [llength $params(pages)]} {incr i} { - set pages [lindex $params(pages) $i] - set callback [lindex $params(callbacks) $i] - - runTest {test [appendArgs backup-1. $i] {BackupDatabase method} -setup { - setupDb [set fileName(1) :memory:] "" "" "" "" "" false memDb - setupDb [set fileName(2) [appendArgs backup-1. $i .db]] - } -body { - set id [object invoke Interpreter.GetActive NextId] - set dataSource [file join [getDatabaseDirectory] $fileName(2)] - - sql execute $memDb { - CREATE TABLE t1(x TEXT); - } - - for {set index 0} {$index < 10} {incr index} { - sql execute $memDb [subst { - INSERT INTO t1 (x) VALUES('[string repeat ! 1048576]'); - }] - } - - set memSource [object invoke -flags +NonPublic -objectflags +NoDispose \ - Interpreter.GetActive.connections get_Item $memDb] - - unset -nocomplain results errors - - set code [compileCSharpWith [subst { - using System; - using System.Data.SQLite; - using System.Text; - using Eagle._Components.Public; - - namespace _Dynamic${id} - { - public static class Test${id} - { - public static int count = 0; - public static readonly StringBuilder results = new StringBuilder(); - - ///////////////////////////////////////////////////////////////////// - - public static bool BackupCallback( - SQLiteConnection source, - string sourceName, - SQLiteConnection destination, - string destinationName, - int pages, - int remainingPages, - int totalPages, - bool retry - ) - { - results.AppendFormat("{0} {1} {2} {3} {4} {5} {6} {7} ", source, - sourceName, destination, destinationName, pages, remainingPages, - totalPages, retry); - - count++; - - return (pages != 2); - } - - ///////////////////////////////////////////////////////////////////// - - public static string BackupAndGetData( - Interpreter interpreter, - SQLiteConnection source - ) - { - using (SQLiteConnection destination = new SQLiteConnection( - "Data Source=${dataSource};")) - { - destination.Open(); - - int pages = ${pages}; - - source.BackupDatabase(destination, "main", "main", pages, - ${callback}, 0); - - ReturnCode code; - Result error = null; - - code = interpreter.SetVariableValue( - VariableFlags.GlobalOnly, "callbackResults", (pages > 2) ? - results.ToString().Trim() : count.ToString(), null, - ref error); - - if (code != ReturnCode.Ok) - Utility.Complain(interpreter, code, error); - - using (SQLiteCommand command = new SQLiteCommand( - "SELECT length(x) FROM t1;", destination)) - { - using (SQLiteDataReader dataReader = command.ExecuteReader()) - { - StringBuilder builder = new StringBuilder(); - int rowCount = 0; - - builder.Append(dataReader.FieldCount); - builder.Append(' '); - - while (dataReader.Read()) - { - builder.Append(dataReader.GetInt64(0)); - builder.Append(' '); - rowCount++; - } - - builder.Append(rowCount); - return builder.ToString(); - } - } - } - } - - ///////////////////////////////////////////////////////////////////// - - public static void Main() - { - // do nothing. - } - } - } - }] true true true results errors [list System.Data.SQLite.dll Eagle.dll]] - - set callbackResults [list] - - list $code $results \ - [expr {[info exists errors] ? $errors : ""}] \ - [expr {$code eq "Ok" ? [catch { - object invoke _Dynamic${id}.Test${id} BackupAndGetData "" $memSource - } result] : [set result ""]}] $result $callbackResults - } -cleanup { - cleanupDb $fileName(2) - cleanupDb $fileName(1) memDb - - unset -nocomplain result results errors code index memSource dataSource \ - id memDb db fileName callbackResults - } -constraints \ -{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} \ --match regexp -result [appendArgs \ -"^Ok System#CodeDom#Compiler#CompilerResults#\\d+ \\{\\} " \ -[lindex $params(results) $i]]} -} - -############################################################################### - -unset -nocomplain i params pages callback - -############################################################################### - -runSQLiteTestEpilogue -runTestEpilogue Index: Tests/basic.eagle ================================================================== --- Tests/basic.eagle +++ Tests/basic.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -22,31 +22,19 @@ # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # -set systemDataSQLiteDllFile [getBuildFileName System.Data.SQLite.dll] -set systemDataSQLiteLinqDllFile [getBuildFileName System.Data.SQLite.Linq.dll] set testExeFile [getBuildFileName test.exe] set testLinqExeFile [getBuildFileName testlinq.exe] set testLinqOutFile [file nativename [file join $path testlinq.out]] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteDllFile -} - -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteLinqDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteLinqDllFile -} - if {![haveConstraint [appendArgs file_ [file tail $testExeFile]]]} then { checkForFile $test_channel $testExeFile } if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { @@ -88,11 +76,11 @@ list $code [expr {$code == 0 ? "" : $error}] } -cleanup { cleanupDb $fileName unset -nocomplain code output error fileName -} -constraints {eagle file_System.Data.SQLite.dll file_test.exe} -result {0 {}}} +} -constraints {eagle file_test.exe} -result {0 {}}} ############################################################################### runTest {test data-1.2 {unit tests from the 'testlinq' project} -setup { # @@ -127,12 +115,12 @@ } -cleanup { catch {object invoke Console OutputEncoding $savedEncoding} unset -nocomplain code output error savedEncoding encoding } -constraints \ -{eagle monoToDo file_System.Data.SQLite.dll file_System.Data.SQLite.Linq.dll\ -file_testlinq.exe file_northwindEF.db file_testlinq.out} -result {0 True {}}} +{eagle monoToDo file_testlinq.exe file_northwindEF.db file_testlinq.out} \ +-result {0 True {}}} ############################################################################### runTest {test data-1.3 {SELECT scalar/reader, CREATE, INSERT} -setup { setupDb [set fileName data-1.3.db] @@ -165,21 +153,21 @@ runTest {test data-1.4 {GetSchema with ReservedWords} -setup { setupDb [set fileName data-1.4.db] } -body { set id [object invoke Interpreter.GetActive NextId] - set dataSource [file join [getDatabaseDirectory] $fileName] + set dataSource [file join [getDatabaseDirectory] data-1.4.db] unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static DataTable GetReservedWords() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) @@ -188,12 +176,10 @@ return connection.GetSchema("ReservedWords"); } } - /////////////////////////////////////////////////////////////////////// - public static void Main() { // do nothing. } } @@ -205,11 +191,10 @@ [expr {$code eq "Ok" ? [catch { object invoke _Dynamic${id}.Test${id} GetReservedWords } result] : [set result ""]}] $result } -cleanup { cleanupDb $fileName - unset -nocomplain result results errors code dataSource id db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} \ -match regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0\ System#Data#DataTable#\d+$}} @@ -228,21 +213,21 @@ } sql execute $db "CREATE TABLE t2(x INTEGER REFERENCES t3);" set id [object invoke Interpreter.GetActive NextId] - set dataSource [file join [getDatabaseDirectory] $fileName] + set dataSource [file join [getDatabaseDirectory] data-1.5.db] unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static DataRowCollection GetForeignKeys() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) @@ -251,12 +236,10 @@ return connection.GetSchema("ForeignKeys").Rows; } } - /////////////////////////////////////////////////////////////////////// - public static void Main() { // do nothing. } } @@ -276,11 +259,10 @@ [$foreignKey Item TABLE_CATALOG] \ [$foreignKey Item TABLE_NAME] \ [$foreignKey Item CONSTRAINT_TYPE] \ [$foreignKey Item IS_DEFERRABLE] \ [$foreignKey Item INITIALLY_DEFERRED] \ - [$foreignKey Item FKEY_ID] \ [$foreignKey Item FKEY_FROM_COLUMN] \ [$foreignKey Item FKEY_TO_CATALOG] \ [$foreignKey Item FKEY_TO_TABLE] \ [$foreignKey Item FKEY_TO_COLUMN] \ [$foreignKey Item FKEY_FROM_ORDINAL_POSITION] \ @@ -297,31 +279,31 @@ unset -nocomplain result rows foreignKey foreignKeys results errors code \ dataSource id db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} \ -match regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0\ -\{\{main FK_t1_0_0 main t1 \{FOREIGN KEY\} False False 0 x main t2 \{\} 0 \{SET\ -DEFAULT\} CASCADE NONE\} \{main FK_t2_0_0 main t2 \{FOREIGN KEY\} False False 0\ -x main t3 \{\} 0 \{NO ACTION\} \{NO ACTION\} NONE\}\}$}} +\{\{main FK_t1_0 main t1 \{FOREIGN KEY\} False False x main t2 \{\} 0 \{SET\ +DEFAULT\} CASCADE NONE\} \{main FK_t2_0 main t2 \{FOREIGN KEY\} False False x\ +main t3 \{\} 0 \{NO ACTION\} \{NO ACTION\} NONE\}\}$}} ############################################################################### runTest {test data-1.6 {SQLITE_FCNTL_WIN32_AV_RETRY} -setup { setupDb [set fileName data-1.6.db] } -body { set id [object invoke Interpreter.GetActive NextId] - set dataSource [file join [getDatabaseDirectory] $fileName] + set dataSource [file join [getDatabaseDirectory] data-1.6.db] unset -nocomplain results errors set code [compileCSharpWith [subst { using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static bool TestSetAvRetry( ref int count, ref int interval ) @@ -350,12 +332,10 @@ // return (newCount == count && newInterval == interval); } } - /////////////////////////////////////////////////////////////////////// - public static void Main() { // do nothing. } } @@ -415,11 +395,11 @@ set sql { \ BEGIN EXCLUSIVE TRANSACTION; \ CREATE TABLE t1(x INTEGER); \ INSERT INTO t1 (x) VALUES(1); \ - SELECT x FROM t1; \ + SELECT * FROM t1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { @@ -426,11 +406,11 @@ using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) @@ -473,11 +453,11 @@ set sql { \ BEGIN EXCLUSIVE TRANSACTION; \ CREATE TABLE t1(x INTEGER); \ INSERT INTO t1 (x) VALUES(1); \ - SELECT x FROM t1; \ + SELECT * FROM t1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { @@ -484,11 +464,11 @@ using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) @@ -534,11 +514,11 @@ set sql { \ BEGIN EXCLUSIVE TRANSACTION; \ CREATE TABLE t1(x INTEGER); \ INSERT INTO t1 (x) VALUES(1); \ - SELECT x FROM t1; \ + SELECT * FROM t1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { @@ -545,11 +525,11 @@ using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) @@ -868,11 +848,11 @@ set code [compileCSharpWith [subst { using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static string GetConnectionString( string format, string kind ) @@ -885,12 +865,10 @@ builder.Add("DateTimeKind", kind); return builder.ToString(); } - /////////////////////////////////////////////////////////////////////// - public static void Main() { // do nothing. } } @@ -918,13 +896,13 @@ } -cleanup { unset -nocomplain result results errors code id } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \ regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{Date\ -Source=test\.db\} 0 \{Date Source=test\.db;DateTimeFormat=(?:Default|ISO8601)\}\ -0 \{Date Source=test\.db;DateTimeKind=Unspecified\} 0 \{Date\ -Source=test\.db;DateTimeFormat=(?:Default|ISO8601);DateTimeKind=Utc\}$}} +Source=test\.db\} 0 \{Date Source=test\.db;DateTimeFormat=ISO8601\} 0 \{Date\ +Source=test\.db;DateTimeKind=Unspecified\} 0 \{Date\ +Source=test\.db;DateTimeFormat=ISO8601;DateTimeKind=Utc\}$}} ############################################################################### runTest {test data-1.16 {SQLiteConnectionStringBuilder properties} -body { set id [object invoke Interpreter.GetActive NextId] @@ -936,11 +914,11 @@ using System.Data.SQLite; using System.Reflection; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static string GetConnectionString( string key, string value, string propertyName @@ -962,12 +940,10 @@ } return String.Format("{0}, {1}", propertyValue, builder); } - /////////////////////////////////////////////////////////////////////// - public static void Main() { // do nothing. } } @@ -1025,12 +1001,12 @@ Format=False\} 0 \{True, Read Only=True\} 0 \{secret, Password=secret\} 0\ \{4096, Page Size=4096\} 0 \{1024, Max Page Count=1024\} 0 \{8192, Cache\ Size=8192\} 0 \{UnixEpoch, DateTimeFormat=UnixEpoch\} 0 \{Utc,\ DateTimeKind=Utc\} 0 \{sqlite_schema, BaseSchemaName=sqlite_schema\} 0\ \{Memory, Journal Mode=Memory\} 0 \{Serializable, Default\ -IsolationLevel=Serializable\} 0 \{False, Foreign Keys=False\} 0\ -\{LogCallbackException, Flags=(?:Default|LogCallbackException)\}$}} +IsolationLevel=Serializable\} 0 \{False, Foreign Keys=False\} 0 \{Default,\ +Flags=Default\}$}} ############################################################################### runTest {test data-1.17 {SQLiteConvert ToDateTime (Julian Day)} -body { set dateTime [object invoke System.Data.SQLite.SQLiteConvert ToDateTime \ @@ -1048,394 +1024,11 @@ "2012-01-01 12:00:00Z"])} } -constraints {eagle System.Data.SQLite} -result {2455928}} ############################################################################### -runTest {test data-1.19 {SQLiteConvert ToUnixEpoch (Utc)} -body { - # - # NOTE: At first, the test result here may not seem correct; however, the - # same result can be seen by compiling and running the following C# - # code fragment together with the ToUnixEpoch method: - # - # DateTime dateTime; - # Console.WriteLine("dateTime = {0}, unixTime = {1}", - # dateTime = DateTime.Parse("2012-01-01 12:00:00Z"), - # ToUnixEpoch(dateTime)); - # - # The basic problem here is that the Parse [and TryParse] methods of - # the DateTime structure seem to always return local time, even when - # string value clearly indicates otherwise (i.e. the trailing "Z", - # indicating UTC). - # - expr {round([object invoke System.Data.SQLite.SQLiteConvert ToUnixEpoch \ - "2012-01-01 12:00:00Z"])} -} -constraints {eagle System.Data.SQLite} -result {1325390400}} - -############################################################################### - -runTest {test data-1.20 {SQLiteConvert ToUnixEpoch (Local)} -body { - # - # NOTE: At first, the test result here may not seem correct; however, the - # same result can be seen by compiling and running the following C# - # code fragment together with the ToUnixEpoch method: - # - # DateTime dateTime; - # Console.WriteLine("dateTime = {0}, unixTime = {1}", - # dateTime = DateTime.Parse("2012-01-01 12:00:00"), - # ToUnixEpoch(dateTime)); - # - # The basic problem here is that the Parse [and TryParse] methods of - # the DateTime structure seem to always return local time, even when - # string value clearly indicates otherwise (i.e. the trailing "Z", - # indicating UTC). - # - expr {round([object invoke System.Data.SQLite.SQLiteConvert ToUnixEpoch \ - "2012-01-01 12:00:00"])} -} -constraints {eagle System.Data.SQLite} -result {1325419200}} - -############################################################################### - -runTest {test data-1.21 {SQLiteTransaction disposal behavior} -setup { - setupDb [set fileName data-1.21.db] -} -body { - sql execute $db "CREATE TABLE t1(x TEXT);" - - sql execute $db { - INSERT INTO t1 (x) VALUES('test1'); - INSERT INTO t1 (x) VALUES('test2'); - INSERT INTO t1 (x) VALUES('test3'); - } - - set sql "SELECT x FROM t1 ORDER BY x COLLATE DOTHROW;" - - set id [object invoke Interpreter.GetActive NextId] - set dataSource [file join [getDatabaseDirectory] $fileName] - - unset -nocomplain results errors - - set code [compileCSharpWith [subst { - using System; - using System.Data.SQLite; - - namespace _Dynamic${id} - { - \[SQLiteFunction(Name = "DOTHROW", FuncType = FunctionType.Collation)\] - public class Test${id} : SQLiteFunction - { - public override int Compare( - string param1, - string param2 - ) - { - throw new Exception("not implemented"); - } - - /////////////////////////////////////////////////////////////////////// - - public static void Main() - { - SQLiteFunction.RegisterFunction(typeof(Test${id})); - - using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};")) - { - connection.Open(); - - using (SQLiteTransaction transaction = - connection.BeginTransaction()) - { - try - { - SQLiteCommand command = connection.CreateCommand(); - - command.CommandText = "${sql}"; - command.ExecuteNonQuery(); - } - catch - { - // do nothing. - } - } - } - } - } - } - }] true true true results errors System.Data.SQLite.dll] - - list $code $results \ - [expr {[info exists errors] ? $errors : ""}] \ - [expr {$code eq "Ok" ? [catch { - object invoke _Dynamic${id}.Test${id} Main - } result] : [set result ""]}] $result -} -cleanup { - cleanupDb $fileName - - unset -nocomplain result results errors code sql dataSource id db fileName -} -constraints \ -{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \ -regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \{\}$}} - -############################################################################### - -runTest {test data-1.22 {SQLiteFunction collation exception} -setup { - setupDb [set fileName data-1.22.db] -} -body { - sql execute $db "CREATE TABLE t1(x TEXT);" - - sql execute $db { - INSERT INTO t1 (x) VALUES('test1'); - INSERT INTO t1 (x) VALUES('test2'); - INSERT INTO t1 (x) VALUES('test3'); - } - - set sql "SELECT x FROM t1 ORDER BY x COLLATE DOTHROW2;" - - set id [object invoke Interpreter.GetActive NextId] - set dataSource [file join [getDatabaseDirectory] $fileName] - - unset -nocomplain results errors - - set code [compileCSharpWith [subst { - using System; - using System.Data.SQLite; - - namespace _Dynamic${id} - { - \[SQLiteFunction(Name = "DOTHROW2", FuncType = FunctionType.Collation)\] - public class Test${id} : SQLiteFunction - { - public override int Compare( - string param1, - string param2 - ) - { - throw new Exception("not implemented"); - } - - /////////////////////////////////////////////////////////////////////// - - public static int Main() - { - SQLiteFunction.RegisterFunction(typeof(Test${id})); - - using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};")) - { - connection.Open(); - - using (SQLiteTransaction transaction = - connection.BeginTransaction()) - { - SQLiteCommand command = connection.CreateCommand(); - - command.CommandText = "${sql}"; - - using (SQLiteDataReader dataReader = command.ExecuteReader()) - { - int count = 0; - - while (dataReader.Read()) - count++; - - return count; - } - } - } - } - } - } - }] true true true results errors System.Data.SQLite.dll] - - list $code $results \ - [expr {[info exists errors] ? $errors : ""}] \ - [expr {$code eq "Ok" ? [catch { - object invoke _Dynamic${id}.Test${id} Main - } result] : [set result ""]}] $result -} -cleanup { - cleanupDb $fileName - - unset -nocomplain result results errors code sql dataSource id db fileName -} -constraints \ -{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -match \ -regexp -result {^Ok System#CodeDom#Compiler#CompilerResults#\d+ \{\} 1\ -\{System\.Reflection\.TargetInvocationException: Exception has been thrown by\ -the target of an invocation\. ---> System\.Data\.SQLite\.SQLiteException:\ -Operation terminated by sqlite3_interrupt\(\).*$}} - -############################################################################### - -runTest {test data-1.23 {LINQ SQL_CONSTRAINTCOLUMNS resource} -body { - object invoke -flags +NonPublic System.Data.SQLite.Properties.Resources \ - SQL_CONSTRAINTCOLUMNS -} -constraints {eagle System.Data.SQLite System.Data.SQLite.Linq} -result { - CREATE TEMP VIEW SCHEMACONSTRAINTCOLUMNS AS - SELECT CONSTRAINT_CATALOG, - NULL AS CONSTRAINT_SCHEMA, - CONSTRAINT_NAME, - TABLE_CATALOG, - NULL AS TABLE_SCHEMA, - TABLE_NAME, - COLUMN_NAME - FROM TEMP.SCHEMAINDEXCOLUMNS - UNION - SELECT CONSTRAINT_CATALOG, - NULL, - CONSTRAINT_NAME, - TABLE_CATALOG, - NULL, - TABLE_NAME, - FKEY_FROM_COLUMN - FROM TEMP.SCHEMAFOREIGNKEYS; - }} - -############################################################################### - -runTest {test data-1.24 {LINQ SQL_CONSTRAINTS resource} -body { - object invoke -flags +NonPublic System.Data.SQLite.Properties.Resources \ - SQL_CONSTRAINTS -} -constraints {eagle System.Data.SQLite System.Data.SQLite.Linq} -result { - CREATE TEMP VIEW SCHEMACONSTRAINTS AS - SELECT INDEX_CATALOG AS CONSTRAINT_CATALOG, - NULL AS CONSTRAINT_SCHEMA, - INDEX_NAME AS CONSTRAINT_NAME, - TABLE_CATALOG, - NULL AS TABLE_SCHEMA, - TABLE_NAME, - 'PRIMARY KEY' AS CONSTRAINT_TYPE, - 0 AS IS_DEFERRABLE, - 0 AS INITIALLY_DEFERRED, - NULL AS CHECK_CLAUSE - FROM TEMP.SCHEMAINDEXES - WHERE PRIMARY_KEY = 1 - UNION - SELECT INDEX_CATALOG, - NULL, - INDEX_NAME, - TABLE_CATALOG, - NULL, - TABLE_NAME, - 'UNIQUE', - 0, - 0, - NULL - FROM TEMP.SCHEMAINDEXES - WHERE PRIMARY_KEY = 0 AND [UNIQUE] = 1 - UNION - SELECT CONSTRAINT_CATALOG, - NULL, - CONSTRAINT_NAME, - TABLE_CATALOG, - NULL, - TABLE_NAME, - CONSTRAINT_TYPE, - IS_DEFERRABLE, - INITIALLY_DEFERRED, - NULL - FROM TEMP.SCHEMAFOREIGNKEYS; - }} - -############################################################################### - -runTest {test data-1.25 {SQLiteDataReader GetValues w/collection} -setup { - setupDb [set fileName data-1.25.db] -} -body { - sql execute $db { - CREATE TABLE t1(x INTEGER PRIMARY KEY ASC, y TEXT); - INSERT INTO t1 (x, y) VALUES(1, 'aardvark'); - INSERT INTO t1 (x, y) VALUES(2, 'bear'); - INSERT INTO t1 (x, y) VALUES(3, 'chicken'); - INSERT INTO t1 (x, y) VALUES(4, 'duck'); - INSERT INTO t1 (x, y) VALUES(5, 'elephant'); - INSERT INTO t1 (x, y) VALUES(6, 'frog'); - INSERT INTO t1 (x, y) VALUES(7, 'goose'); - INSERT INTO t1 (x, y) VALUES(8, 'horse'); - INSERT INTO t1 (x, y) VALUES(9, 'iguana'); - INSERT INTO t1 (x, y) VALUES(10, 'jellyfish'); - INSERT INTO t1 (x, y) VALUES(11, 'kangaroo'); - INSERT INTO t1 (x, y) VALUES(12, 'llama'); - INSERT INTO t1 (x, y) VALUES(13, 'moose'); - INSERT INTO t1 (x, y) VALUES(14, 'newt'); - INSERT INTO t1 (x, y) VALUES(15, 'ostrich'); - INSERT INTO t1 (x, y) VALUES(16, 'pig'); - INSERT INTO t1 (x, y) VALUES(17, 'quail'); - INSERT INTO t1 (x, y) VALUES(18, 'rhinoceros'); - INSERT INTO t1 (x, y) VALUES(19, 'shark'); - INSERT INTO t1 (x, y) VALUES(20, 'tiger'); - INSERT INTO t1 (x, y) VALUES(21, 'unicorn'); - INSERT INTO t1 (x, y) VALUES(22, 'viper'); - INSERT INTO t1 (x, y) VALUES(23, 'weasel'); - INSERT INTO t1 (x, y) VALUES(24, 'xerus'); - INSERT INTO t1 (x, y) VALUES(25, 'yak'); - INSERT INTO t1 (x, y) VALUES(26, 'zebra'); - } - - set connection [object invoke -flags +NonPublic -objectflags +NoDispose \ - Interpreter.GetActive.connections get_Item $db] - - set command [object create -alias System.Data.SQLite.SQLiteCommand \ - "SELECT x, y, x, y FROM t1 ORDER BY y DESC;" $connection] - - set reader [$command -alias ExecuteReader] - set collection [$reader -alias GetValues] - set result [list] - - object foreach -alias item $collection { - lappend result [$collection GetValues $item] - } - - set result -} -cleanup { - cleanupDb $fileName - - unset -nocomplain result item collection reader command connection db \ - fileName -} -constraints \ -{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ -{{26 26} {zebra zebra}}} - -############################################################################### - -runTest {test data-1.26 {LINQ ISQLiteSchemaExtensions.BuildTempSchema} -setup { - setupDb [set fileName data-1.26.db] -} -body { - set connection [object invoke -flags +NonPublic -objectflags +NoDispose \ - Interpreter.GetActive.connections Item $db] - - set providerServices [object invoke -flags +NonPublic \ - System.Data.SQLite.SQLiteProviderServices Instance] - - object invoke -flags +NonPublic -type \ - System.Data.SQLite.ISQLiteSchemaExtensions $providerServices \ - BuildTempSchema $connection -} -cleanup { - cleanupDb $fileName - - unset -nocomplain providerServices connection db fileName -} -constraints {eagle System.Data.SQLite System.Data.SQLite.Linq} -result {}} - -############################################################################### - -runTest {test data-1.27 {VARCHAR / NVARCHAR types with spaces} -body { - list [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \ - TypeNameToDbType "VARCHAR"] \ - [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \ - TypeNameToDbType "NVARCHAR"] \ - [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \ - TypeNameToDbType "VARCHAR(1)"] \ - [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \ - TypeNameToDbType "NVARCHAR(1)"] \ - [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \ - TypeNameToDbType "VARCHAR (1)"] \ - [object invoke -flags +NonPublic System.Data.SQLite.SQLiteConvert \ - TypeNameToDbType "NVARCHAR (1)"] \ -} -constraints {eagle System.Data.SQLite} -result \ -{String String String String String String}} - -############################################################################### - -unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \ - testExeFile testLinqExeFile northwindEfDbFile testLinqOutFile +unset -nocomplain testExeFile testLinqExeFile northwindEfDbFile testLinqOutFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue Index: Tests/common.eagle ================================================================== --- Tests/common.eagle +++ Tests/common.eagle @@ -20,17 +20,14 @@ proc getBuildYear {} { # # NOTE: See if the "year" setting has been overridden by the user (e.g. on # the command line). This helps control exactly which set of - # binaries we are testing, those produced using the Visual Studio - # 2005, 2008, or 2010 build systems. To override this value via the - # command line, enter a command similar to one of the following (all - # on one line): - # - # EagleShell.exe -preInitialize "set test_year 2005" - # -file .\path\to\all.eagle + # binaries we are testing, those produced using either the Visual + # Studio 2008 or Visual Studio 2010 build systems. To override this + # value via the command line, enter a command similar to one of the + # following (all on one line): # # EagleShell.exe -preInitialize "set test_year 2008" # -file .\path\to\all.eagle # # EagleShell.exe -preInitialize "set test_year 2010" @@ -47,14 +44,13 @@ # return $::test_year } else { # # NOTE: If Eagle has been compiled against the .NET Framework 4.0, use - # "2010" as the test year; otherwise, use "2008" (we could use - # "2005" in that case as well). If another major [incompatible] - # version of the .NET Framework is released, this check will have - # to be changed. + # "2010" as the test year; otherwise, use "2008". If another + # major [incompatible] version of the .NET Framework is released, + # this check will have to be changed. # return [expr {[haveConstraint imageRuntime40] ? "2010" : "2008"}] } } @@ -229,11 +225,11 @@ # directory, can be transferred to the interpreter in the isolated # application domain, making it able to successfully run tests that # require one or more of the files in the build directory. Callers # to this procedure should keep in mind that the test script being # returned cannot only rely on any script library procedures not - # included in the Eagle.Library package (i.e. "init.eagle"). Also, + # included in the EagleLibrary package (i.e. "init.eagle"). Also, # all variable references and all "nested" commands (i.e. those in # square brackets), unless they are specially quoted, will end up # being evaluated in the context of the calling interpreter and not # the test interpreter created in the isolated application domain. # @@ -314,11 +310,11 @@ proc tryLoadAssembly { fileName } { set fileName [getBinaryFileName $fileName] if {[catch {set assembly \ - [object load -loadtype File -alias $fileName]}] == 0} then { + [object load -loadtype File -alias $fileName]}] == 0} then { # # NOTE: Now, add the necessary test constraint. # addConstraint [file rootname [file tail $fileName]] @@ -364,33 +360,10 @@ } else { tputs $channel no\n } } - proc checkForSQLiteDefineConstant { channel name } { - tputs $channel [appendArgs \ - "---- checking for System.Data.SQLite define constant \"" $name \ - "\"... "] - - if {[catch {object invoke -flags +NonPublic System.Data.SQLite.SQLite3 \ - DefineConstants} defineConstants] == 0} then { - if {[lsearch -exact -nocase $defineConstants $name] != -1} then { - # - # NOTE: Yes, this define constant was enabled when the managed - # assembly was compiled. - # - addConstraint [appendArgs defineConstant.System.Data.SQLite. $name] - - tputs $channel yes\n - } else { - tputs $channel no\n - } - } else { - tputs $channel error\n - } - } - proc getDateTimeFormat {} { # # NOTE: This procedure simply returns the "default" DateTime format used # by the test suite. # @@ -428,29 +401,24 @@ } proc compileCSharpWith { text memory symbols strict resultsVarName errorsVarName fileNames args } { - # - # NOTE: Since we are going to use this method name a lot, assign it to a - # variable first. - # - set add ReferencedAssemblies.Add - # # NOTE: Create the base command to evaluate and add the property settings # that are almost always needed by our unit tests (i.e. the System # and System.Data assembly references). # set command [list compileCSharp $text $memory $symbols $strict results \ - errors $add System.dll $add System.Data.dll $add System.Xml.dll] + errors ReferencedAssemblies.Add System.dll ReferencedAssemblies.Add \ + System.Data.dll ReferencedAssemblies.Add System.Xml.dll] # # NOTE: Add all the provided file names as assembly references. # foreach fileName $fileNames { - lappend command $add [getBinaryFileName $fileName] + lappend command ReferencedAssemblies.Add [getBinaryFileName $fileName] } # # NOTE: Add the extra arguments, if any, to the command to evaluate. # @@ -468,39 +436,25 @@ # result. # eval $command } - proc isMemoryDb { fileName } { - # - # NOTE: Is the specified database file name really an in-memory database? - # - return [expr {$fileName eq ":memory:"}] - } - proc setupDb { - fileName {mode ""} {dateTimeFormat ""} {dateTimeKind ""} {flags ""} + fileName {mode ""} {dateTimeFormat ""} {dateTimeKind ""} {flags "LogPrepare"} {extra ""} {delete true} {varName db} } { - # - # NOTE: First, see if the caller has requested an in-memory database. - # - set isMemory [isMemoryDb $fileName] - # # NOTE: For now, all test databases used by the test suite are placed into # the temporary directory. Each database used by a test should be # cleaned up by that test using the "cleanupDb" procedure, below. # - if {!$isMemory} then { - set fileName [file join [getDatabaseDirectory] [file tail $fileName]] - } + set fileName [file join [getDatabaseDirectory] [file tail $fileName]] # # NOTE: By default, delete any pre-existing database with the same file # name if it currently exists. # - if {!$isMemory && $delete && [file exists $fileName]} then { + if {$delete && [file exists $fileName]} then { # # NOTE: Attempt to delete any pre-existing database with the same file # name. # if {[catch {file delete $fileName} error]} then { @@ -547,33 +501,10 @@ # if {[string length $dateTimeKind] > 0} then { append connection {;DateTimeKind=${dateTimeKind}} } - # - # NOTE: If there are any global (per test run) connection flags currently - # set, use them now (i.e. by combining them with the ones for this - # connection). - # - if {[info exists ::connection_flags] && \ - [string length $::connection_flags] > 0} then { - # - # NOTE: Show (and log) that we detected some global connection flags. - # - tputs $::test_channel [appendArgs \ - "---- global connection flags detected: " $::connection_flags \n] - - # - # NOTE: Combine and/or replace the connection flags and then show the - # new value. - # - set flags [combineFlags $flags $::connection_flags] - - tputs $::test_channel [appendArgs \ - "---- combined connection flags are: " $flags \n] - } - # # NOTE: If the caller specified a SQLiteConnectionFlags, add the necessary # portion of the connection string now. # if {[string length $flags] > 0} then { @@ -613,27 +544,20 @@ tputs $::test_channel [appendArgs \ "==== WARNING: failed to close database \"" $db "\", error: " \ \n\t $error \n] } - # - # NOTE: First, see if the caller has requested an in-memory database. - # - set isMemory [isMemoryDb $fileName] - # # NOTE: Build the full path to the database file name. For now, all test # database files are stored in the temporary directory. # - if {!$isMemory} then { - set fileName [file join [getDatabaseDirectory] [file tail $fileName]] - } + set fileName [file join [getDatabaseDirectory] [file tail $fileName]] # # NOTE: Check if the file still exists. # - if {!$isMemory && [file exists $fileName]} then { + if {[file exists $fileName]} then { # # NOTE: Skip deleting database files if somebody sets the global # variable to prevent it. # if {![info exists ::no(cleanupDb)]} then { @@ -805,20 +729,13 @@ # # NOTE: Skip trying to delete any files if we are so instructed. # if {![info exists ::no(deleteSqliteFiles)]} then { tryDeleteAssembly sqlite3.dll - removeConstraint file_sqlite3.dll - tryDeleteAssembly SQLite.Interop.dll - removeConstraint file_SQLite.Interop.dll - tryDeleteAssembly System.Data.SQLite.dll - removeConstraint file_System.Data.SQLite.dll - tryDeleteAssembly System.Data.SQLite.Linq.dll - removeConstraint file_System.Data.SQLite.Linq.dll } # # NOTE: Skip trying to copy any files if we are so instructed. # @@ -863,40 +780,19 @@ tputs $::test_channel [appendArgs \ "---- found assembly: " $assembly \n] } } - catch { - tputs $::test_channel \ - "---- define constants for \"System.Data.SQLite\"... " - - if {[catch {object invoke -flags +NonPublic \ - System.Data.SQLite.SQLite3 DefineConstants} \ - defineConstants] == 0} then { - tputs $::test_channel [appendArgs [formatList [lsort \ - $defineConstants]] \n] - } else { - tputs $::test_channel unknown\n - } - } - # # NOTE: Now, we need to know if the SQLite core library is available # (i.e. because the managed-only System.Data.SQLite assembly can # load without it; however, it cannot do anything useful without # it). If we are using the mixed-mode assembly and we already # found it (above), this should always succeed. # checkForSQLite $::test_channel - # - # NOTE: Attempt to determine if the custom extension functions were - # compiled into the SQLite interop assembly. - # - checkForSQLiteDefineConstant $::test_channel \ - INTEROP_EXTENSION_FUNCTIONS - # # NOTE: Report the resource usage prior to running any tests. # reportSQLiteResources $::test_channel @@ -903,32 +799,18 @@ # # NOTE: Show the active test constraints. # tputs $::test_channel [appendArgs "---- constraints: " \ [formatList [lsort [getConstraints]]] \n] - - # - # NOTE: Show when our tests actually began (now). - # - tputs $::test_channel [appendArgs \ - "---- System.Data.SQLite tests began at " \ - [clock format [clock seconds]] \n] } } proc runSQLiteTestEpilogue {} { # # NOTE: Skip running our custom epilogue if the main one has been skipped. # if {![info exists ::no(epilogue.eagle)]} then { - # - # NOTE: Show when our tests actually ended (now). - # - tputs $::test_channel [appendArgs \ - "---- System.Data.SQLite tests ended at " \ - [clock format [clock seconds]] \n] - # # NOTE: Also report the resource usage after running the tests. # reportSQLiteResources $::test_channel } Index: Tests/installer.eagle ================================================================== --- Tests/installer.eagle +++ Tests/installer.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -24,30 +24,16 @@ # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # set systemDataSQLiteDllFile [getBuildFileName System.Data.SQLite.dll] set installerExeFile [getBuildFileName Installer.exe] - -# -# NOTE: The various install/uninstall log files used to test the design-time -# component installer. -# -set testInstallVs2005LogFile [file nativename [file join $path \ - Installer_Test_Vs2005.log]] - set testInstallVs2008LogFile [file nativename [file join $path \ Installer_Test_Vs2008.log]] - set testInstallVs2010LogFile [file nativename [file join $path \ Installer_Test_Vs2010.log]] - -set testUninstallVs2005LogFile [file nativename [file join $path \ - Uninstaller_Test_Vs2005.log]] - set testUninstallVs2008LogFile [file nativename [file join $path \ Uninstaller_Test_Vs2008.log]] - set testUninstallVs2010LogFile [file nativename [file join $path \ Uninstaller_Test_Vs2010.log]] # # NOTE: Setup the test constraints specific to the tests in this file. @@ -55,15 +41,10 @@ if {![haveConstraint [appendArgs file_ \ [file tail $installerExeFile]]]} then { checkForFile $test_channel $installerExeFile } -if {![haveConstraint [appendArgs file_ \ - [file tail $testInstallVs2005LogFile]]]} then { - checkForFile $test_channel $testInstallVs2005LogFile -} - if {![haveConstraint [appendArgs file_ \ [file tail $testInstallVs2008LogFile]]]} then { checkForFile $test_channel $testInstallVs2008LogFile } @@ -70,15 +51,10 @@ if {![haveConstraint [appendArgs file_ \ [file tail $testInstallVs2010LogFile]]]} then { checkForFile $test_channel $testInstallVs2010LogFile } -if {![haveConstraint [appendArgs file_ \ - [file tail $testUninstallVs2005LogFile]]]} then { - checkForFile $test_channel $testUninstallVs2005LogFile -} - if {![haveConstraint [appendArgs file_ \ [file tail $testUninstallVs2008LogFile]]]} then { checkForFile $test_channel $testUninstallVs2008LogFile } @@ -87,81 +63,11 @@ checkForFile $test_channel $testUninstallVs2010LogFile } ############################################################################### -runTest {test installer-1.1 {installer tool / Visual Studio 2005} -setup { - set fileName [file join [getTemporaryPath] [file tail [string map [list \ - .log [appendArgs _ [pid] .log]] $testInstallVs2005LogFile]]] - - cleanupFile $fileName -} -body { - set output "" - - set code [catch { - testClrExec $installerExeFile [list -eventflags Wait -stdout output \ - -success 0] -debugPriority Lowest -tracePriority MediumHigh \ - -noRuntimeVersion true -noCompact true -noNetFx40 true -noVs2008 true \ - -noVs2010 true -whatIf true -verbose true -confirm true -install true \ - -logFileName [appendArgs \" [file nativename $fileName] \"] \ - -traceFormat [appendArgs \" "#{0}: {2}" \"] -debug true -wow64 true - } error] - - tlog "---- BEGIN STDOUT OUTPUT\n" - tlog $output - tlog "\n---- END STDOUT OUTPUT\n" - - set wow64 [expr {[haveConstraint amd64.64bit] ? "\\Wow6432Node" : ""}] - - list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ - [subst -nobackslashes [readFile $testInstallVs2005LogFile]]] : $error}] -} -cleanup { - cleanupFile $fileName - - unset -nocomplain wow64 code output error fileName -} -constraints {eagle administrator visualStudio2005\ -System.Data.SQLite.dll_v2.0.50727 file_Installer.exe\ -file_Installer_Test_Vs2005.log} -result {0 True}} - -############################################################################### - -runTest {test installer-1.2 {uninstaller tool / Visual Studio 2005} -setup { - set fileName [file join [getTemporaryPath] [file tail [string map [list \ - .log [appendArgs _ [pid] .log]] $testUninstallVs2005LogFile]]] - - cleanupFile $fileName -} -body { - set output "" - - set code [catch { - testClrExec $installerExeFile [list -eventflags Wait -stdout output \ - -success 0] -debugPriority Lowest -tracePriority MediumHigh \ - -noRuntimeVersion true -noCompact true -noNetFx40 true -noVs2008 true \ - -noVs2010 true -whatIf true -verbose true -confirm true -install false \ - -logFileName [appendArgs \" [file nativename $fileName] \"] \ - -traceFormat [appendArgs \" "#{0}: {2}" \"] -debug true -wow64 true - } error] - - tlog "---- BEGIN STDOUT OUTPUT\n" - tlog $output - tlog "\n---- END STDOUT OUTPUT\n" - - set wow64 [expr {[haveConstraint amd64.64bit] ? "\\Wow6432Node" : ""}] - - list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ - [subst -nobackslashes [readFile $testUninstallVs2005LogFile]]] : $error}] -} -cleanup { - cleanupFile $fileName - - unset -nocomplain wow64 code output error fileName -} -constraints {eagle administrator visualStudio2005\ -System.Data.SQLite.dll_v2.0.50727 file_Installer.exe\ -file_Uninstaller_Test_Vs2005.log} -result {0 True}} - -############################################################################### - -runTest {test installer-1.3 {installer tool / Visual Studio 2008} -setup { +runTest {test installer-1.1 {installer tool / Visual Studio 2008} -setup { set fileName [file join [getTemporaryPath] [file tail [string map [list \ .log [appendArgs _ [pid] .log]] $testInstallVs2008LogFile]]] cleanupFile $fileName } -body { @@ -168,35 +74,33 @@ set output "" set code [catch { testClrExec $installerExeFile [list -eventflags Wait -stdout output \ -success 0] -debugPriority Lowest -tracePriority MediumHigh \ - -noRuntimeVersion true -noCompact true -noNetFx40 true -noVs2005 true \ - -noVs2010 true -whatIf true -verbose true -confirm true -install true \ + -noRuntimeVersion true -noCompact true -noNetFx40 true -noVs2010 true \ + -whatIf true -verbose true -confirm true -install true \ -logFileName [appendArgs \" [file nativename $fileName] \"] \ - -traceFormat [appendArgs \" "#{0}: {2}" \"] -debug true -wow64 true + -traceFormat [appendArgs \" "#{0}: {2}" \"] } error] tlog "---- BEGIN STDOUT OUTPUT\n" tlog $output tlog "\n---- END STDOUT OUTPUT\n" - set wow64 [expr {[haveConstraint amd64.64bit] ? "\\Wow6432Node" : ""}] - list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ [subst -nobackslashes [readFile $testInstallVs2008LogFile]]] : $error}] } -cleanup { cleanupFile $fileName - unset -nocomplain wow64 code output error fileName + unset -nocomplain code output error fileName } -constraints {eagle administrator visualStudio2008\ System.Data.SQLite.dll_v2.0.50727 file_Installer.exe\ file_Installer_Test_Vs2008.log} -result {0 True}} ############################################################################### -runTest {test installer-1.4 {uninstaller tool / Visual Studio 2008} -setup { +runTest {test installer-1.2 {uninstaller tool / Visual Studio 2008} -setup { set fileName [file join [getTemporaryPath] [file tail [string map [list \ .log [appendArgs _ [pid] .log]] $testUninstallVs2008LogFile]]] cleanupFile $fileName } -body { @@ -203,35 +107,33 @@ set output "" set code [catch { testClrExec $installerExeFile [list -eventflags Wait -stdout output \ -success 0] -debugPriority Lowest -tracePriority MediumHigh \ - -noRuntimeVersion true -noCompact true -noNetFx40 true -noVs2005 true \ - -noVs2010 true -whatIf true -verbose true -confirm true -install false \ + -noRuntimeVersion true -noCompact true -noNetFx40 true -noVs2010 true \ + -whatIf true -verbose true -confirm true -install false \ -logFileName [appendArgs \" [file nativename $fileName] \"] \ - -traceFormat [appendArgs \" "#{0}: {2}" \"] -debug true -wow64 true + -traceFormat [appendArgs \" "#{0}: {2}" \"] } error] tlog "---- BEGIN STDOUT OUTPUT\n" tlog $output tlog "\n---- END STDOUT OUTPUT\n" - set wow64 [expr {[haveConstraint amd64.64bit] ? "\\Wow6432Node" : ""}] - list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ [subst -nobackslashes [readFile $testUninstallVs2008LogFile]]] : $error}] } -cleanup { cleanupFile $fileName - unset -nocomplain wow64 code output error fileName + unset -nocomplain code output error fileName } -constraints {eagle administrator visualStudio2008\ System.Data.SQLite.dll_v2.0.50727 file_Installer.exe\ file_Uninstaller_Test_Vs2008.log} -result {0 True}} ############################################################################### -runTest {test installer-1.5 {installer tool / Visual Studio 2010} -setup { +runTest {test installer-1.3 {installer tool / Visual Studio 2010} -setup { set fileName [file join [getTemporaryPath] [file tail [string map [list \ .log [appendArgs _ [pid] .log]] $testInstallVs2010LogFile]]] cleanupFile $fileName } -body { @@ -238,35 +140,33 @@ set output "" set code [catch { testClrExec $installerExeFile [list -eventflags Wait -stdout output \ -success 0] -debugPriority Lowest -tracePriority MediumHigh \ - -noRuntimeVersion true -noCompact true -noNetFx20 true -noVs2005 true \ - -noVs2008 true -whatIf true -verbose true -confirm true -install true \ + -noRuntimeVersion true -noCompact true -noNetFx20 true -noVs2008 true \ + -whatIf true -verbose true -confirm true -install true \ -logFileName [appendArgs \" [file nativename $fileName] \"] \ - -traceFormat [appendArgs \" "#{0}: {2}" \"] -debug true -wow64 true + -traceFormat [appendArgs \" "#{0}: {2}" \"] } error] tlog "---- BEGIN STDOUT OUTPUT\n" tlog $output tlog "\n---- END STDOUT OUTPUT\n" - set wow64 [expr {[haveConstraint amd64.64bit] ? "\\Wow6432Node" : ""}] - list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ [subst -nobackslashes [readFile $testInstallVs2010LogFile]]] : $error}] } -cleanup { cleanupFile $fileName - unset -nocomplain wow64 code output error fileName + unset -nocomplain code output error fileName } -constraints {eagle administrator visualStudio2010\ System.Data.SQLite.dll_v4.0.30319 file_Installer.exe\ file_Installer_Test_Vs2010.log} -result {0 True}} ############################################################################### -runTest {test installer-1.6 {uninstaller tool / Visual Studio 2010} -setup { +runTest {test installer-1.4 {uninstaller tool / Visual Studio 2010} -setup { set fileName [file join [getTemporaryPath] [file tail [string map [list \ .log [appendArgs _ [pid] .log]] $testUninstallVs2010LogFile]]] cleanupFile $fileName } -body { @@ -273,38 +173,35 @@ set output "" set code [catch { testClrExec $installerExeFile [list -eventflags Wait -stdout output \ -success 0] -debugPriority Lowest -tracePriority MediumHigh \ - -noRuntimeVersion true -noCompact true -noNetFx20 true -noVs2005 true \ - -noVs2008 true -whatIf true -verbose true -confirm true -install false \ + -noRuntimeVersion true -noCompact true -noNetFx20 true -noVs2008 true \ + -whatIf true -verbose true -confirm true -install false \ -logFileName [appendArgs \" [file nativename $fileName] \"] \ - -traceFormat [appendArgs \" "#{0}: {2}" \"] -debug true -wow64 true + -traceFormat [appendArgs \" "#{0}: {2}" \"] } error] tlog "---- BEGIN STDOUT OUTPUT\n" tlog $output tlog "\n---- END STDOUT OUTPUT\n" - set wow64 [expr {[haveConstraint amd64.64bit] ? "\\Wow6432Node" : ""}] - list $code [expr {$code == 0 ? [string equal [readFile $fileName] \ [subst -nobackslashes [readFile $testUninstallVs2010LogFile]]] : $error}] } -cleanup { cleanupFile $fileName - unset -nocomplain wow64 code output error fileName + unset -nocomplain code output error fileName } -constraints {eagle administrator visualStudio2010\ System.Data.SQLite.dll_v4.0.30319 file_Installer.exe\ file_Uninstaller_Test_Vs2010.log} -result {0 True}} ############################################################################### unset -nocomplain testUninstallVs2010LogFile testUninstallVs2008LogFile \ - testUninstallVs2005LogFile testInstallVs2010LogFile \ - testInstallVs2008LogFile testInstallVs2005LogFile installerExeFile \ + testInstallVs2010LogFile testInstallVs2008LogFile installerExeFile \ systemDataSQLiteDllFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue Index: Tests/tkt-00f86f9739.eagle ================================================================== --- Tests/tkt-00f86f9739.eagle +++ Tests/tkt-00f86f9739.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -22,29 +22,17 @@ # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # -set systemDataSQLiteDllFile [getBuildFileName System.Data.SQLite.dll] -set systemDataSQLiteLinqDllFile [getBuildFileName System.Data.SQLite.Linq.dll] set testLinqExeFile [getBuildFileName testlinq.exe] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteDllFile -} - -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteLinqDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteLinqDllFile -} - if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile } if {![haveConstraint [appendArgs file_ [file tail $northwindEfDbFile]]]} then { @@ -79,21 +67,17 @@ } set result } -cleanup { unset -nocomplain code output error result value -} -constraints \ -{eagle monoToDo defineConstant.System.Data.SQLite.INTEROP_EXTENSION_FUNCTIONS\ -file_System.Data.SQLite.dll file_System.Data.SQLite.Linq.dll file_testlinq.exe\ -file_northwindEF.db} -result {0 {} 0 {DRACD OLDWO RATTC} 0 {ALFKI CACTU CHOPS\ -FOLKO GALED KOENE LILAS MAGAA MAISD OCEAN RANCH SAVEA THECR} 0 {} 0 {} 0 {} 0\ -{}}} +} -constraints {eagle monoToDo file_testlinq.exe file_northwindEF.db} -result \ +{0 {} 0 {DRACD OLDWO RATTC} 0 {ALFKI CACTU CHOPS FOLKO GALED KOENE LILAS MAGAA\ +MAISD OCEAN RANCH SAVEA THECR} 0 {} 0 {} 0 {} 0 {}}} ############################################################################### -unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \ - testLinqExeFile northwindEfDbFile +unset -nocomplain testLinqExeFile northwindEfDbFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue Index: Tests/tkt-0d5b1ef362.eagle ================================================================== --- Tests/tkt-0d5b1ef362.eagle +++ Tests/tkt-0d5b1ef362.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -32,12 +32,12 @@ # else. # set x [object invoke -flags +NonPublic \ AppDomain.CurrentDomain._domainUnload.GetInvocationList Length] - package require Eagle.Library - package require Eagle.Test + package require EagleLibrary + package require EagleTest package require System.Data.SQLite.Test object load -loadtype File [file join [getBinaryDirectory] \ System.Data.SQLite.dll] Index: Tests/tkt-201128cc88.eagle ================================================================== --- Tests/tkt-201128cc88.eagle +++ Tests/tkt-201128cc88.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -34,13 +34,11 @@ namespace _Dynamic${id} { \[SQLiteFunction(Name = "Base64", FuncType = FunctionType.Scalar)\] public class Test${id} : SQLiteFunction { - public override object Invoke( - object\[\] args - ) + public override object Invoke(object\[\] args) { if (args == null) return null; if (args.Length != 1) @@ -62,12 +60,10 @@ "argument must be byte array, got {0}", type)); return Convert.ToBase64String((byte\[\]) arg); } - /////////////////////////////////////////////////////////////////////// - public static void Main() { SQLiteFunction.RegisterFunction(typeof(Test${id})); } } Index: Tests/tkt-2c630bffa7.eagle ================================================================== --- Tests/tkt-2c630bffa7.eagle +++ Tests/tkt-2c630bffa7.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### Index: Tests/tkt-2ce0870fad.eagle ================================================================== --- Tests/tkt-2ce0870fad.eagle +++ Tests/tkt-2ce0870fad.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -46,12 +46,12 @@ set hadTestYear {[info exists ::test_year]} set hadTestConfiguration {[info exists ::test_configuration]} }] -body { set appDomainId(3) [object invoke AppDomain.CurrentDomain Id] - package require Eagle.Library - package require Eagle.Test + package require EagleLibrary + package require EagleTest package require System.Data.SQLite.Test set assembly [object load -loadtype File [file join [getBinaryDirectory] \ System.Data.SQLite.dll]] Index: Tests/tkt-343d392b51.eagle ================================================================== --- Tests/tkt-343d392b51.eagle +++ Tests/tkt-343d392b51.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -118,11 +118,11 @@ using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) @@ -224,11 +224,11 @@ using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};DateTimeFormat=JulianDay;")) @@ -371,11 +371,11 @@ using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static void Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) Index: Tests/tkt-448d663d11.eagle ================================================================== --- Tests/tkt-448d663d11.eagle +++ Tests/tkt-448d663d11.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -23,11 +23,10 @@ runTest {test tkt-448d663d11-1.1 {missing journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.1.db] sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} @@ -39,11 +38,10 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName "" "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} @@ -55,11 +53,10 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName "" "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} @@ -68,11 +65,10 @@ runTest {test tkt-448d663d11-1.4 {'Default' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.4.db] Default sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} @@ -84,11 +80,10 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Default "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} @@ -100,11 +95,10 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Default "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} @@ -113,11 +107,10 @@ runTest {test tkt-448d663d11-1.7 {'Delete' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.7.db] Delete sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} @@ -129,11 +122,10 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Delete "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} @@ -145,11 +137,10 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Delete "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} @@ -158,11 +149,10 @@ runTest {test tkt-448d663d11-1.10 {'Persist' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.10.db] Persist sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {persist}} @@ -171,11 +161,10 @@ runTest {test tkt-448d663d11-1.11 {'Off' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.11.db] Off sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {off}} @@ -184,11 +173,10 @@ runTest {test tkt-448d663d11-1.12 {'Truncate' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.12.db] Truncate sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {truncate}} @@ -197,11 +185,10 @@ runTest {test tkt-448d663d11-1.13 {'Memory' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.13.db] Memory sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {memory}} @@ -210,11 +197,10 @@ runTest {test tkt-448d663d11-1.14 {'Wal' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.14.db] Wal sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} @@ -226,11 +212,10 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Wal "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} @@ -242,11 +227,10 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Wal "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} @@ -255,11 +239,10 @@ runTest {test tkt-448d663d11-1.17 {'Bad' journal mode, new db} -body { setupDb [set fileName tkt-448d663d11-1.17.db] Bad sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} @@ -271,11 +254,10 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Bad "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {delete}} @@ -287,15 +269,14 @@ [file join [getDatabaseDirectory] $fileName] setupDb $fileName Bad "" "" "" "" false sql execute -execute scalar $db "PRAGMA journal_mode;" } -cleanup { cleanupDb $fileName - unset -nocomplain db fileName } -constraints \ {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \ {wal}} ############################################################################### runSQLiteTestEpilogue runTestEpilogue Index: Tests/tkt-544dba0a2f.eagle ================================================================== --- Tests/tkt-544dba0a2f.eagle +++ Tests/tkt-544dba0a2f.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### Index: Tests/tkt-59edc1018b.eagle ================================================================== --- Tests/tkt-59edc1018b.eagle +++ Tests/tkt-59edc1018b.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -22,29 +22,17 @@ # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # -set systemDataSQLiteDllFile [getBuildFileName System.Data.SQLite.dll] -set systemDataSQLiteLinqDllFile [getBuildFileName System.Data.SQLite.Linq.dll] set testLinqExeFile [getBuildFileName testlinq.exe] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteDllFile -} - -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteLinqDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteLinqDllFile -} - if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile } if {![haveConstraint [appendArgs file_ [file tail $northwindEfDbFile]]]} then { @@ -79,20 +67,17 @@ } set result } -cleanup { unset -nocomplain code output error result value -} -constraints \ -{eagle monoToDo defineConstant.System.Data.SQLite.INTEROP_EXTENSION_FUNCTIONS\ -file_System.Data.SQLite.dll file_System.Data.SQLite.Linq.dll file_testlinq.exe\ -file_northwindEF.db} -result {0 {} 0 {FURIB GALED GODOS LAZYK LINOD PRINI REGGC\ -WOLZA} 0 {} 0 ERNSH 0 {} 0 {AROUT BSBEV CONSH EASTC NORTS SEVES} 0 {}}} +} -constraints {eagle monoToDo file_testlinq.exe file_northwindEF.db} -result \ +{0 {} 0 {FURIB GALED GODOS LAZYK LINOD PRINI REGGC WOLZA} 0 {} 0 ERNSH 0 {} 0\ +{AROUT BSBEV CONSH EASTC NORTS SEVES} 0 {}}} ############################################################################### -unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \ - testLinqExeFile northwindEfDbFile +unset -nocomplain testLinqExeFile northwindEfDbFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue DELETED Tests/tkt-72905c9a77.eagle Index: Tests/tkt-72905c9a77.eagle ================================================================== --- Tests/tkt-72905c9a77.eagle +++ /dev/null @@ -1,280 +0,0 @@ -############################################################################### -# -# tkt-72905c9a77.eagle -- -# -# Written by Joe Mistachkin. -# Released to the public domain, use at your own risk! -# -############################################################################### - -package require Eagle -package require Eagle.Library -package require Eagle.Test - -runTestPrologue - -############################################################################### - -package require System.Data.SQLite.Test -runSQLiteTestPrologue - -############################################################################### - -# -# NOTE: This value is needed as part of the test result; therefore, it must be -# set outside of the test setup. -# -set id [object invoke Interpreter.GetActive NextId] - -############################################################################### - -# -# NOTE: *WARNING* This test has been extremely carefully designed; however, it -# is still quite sensitive to machine timing, resource availability, etc. -# This test MAY pass even if the bug under test has not been fixed (or -# has been regressed somehow). However, due to the unpredictable nature -# of race conditions, it really is the best that can be done. This test -# will only work as intended if the version of System.Data.SQLite being -# tested is 1.0.77.0 or higher. -# -runTest {test tkt-72905c9a77-1.1 {StaticIsInitialized race condition} -setup { - set fileName tkt-72905c9a77-1.1.db -} -body { - set dataSource [file join [getDatabaseDirectory] $fileName] - - unset -nocomplain results errors - - set code [compileCSharpWith [subst { - using System; - using System.Data.SQLite; - using System.Diagnostics; - using System.IO; - using System.Reflection; - using System.Text; - using System.Threading; - - namespace _Dynamic${id} - { - public static class Test${id} - { - public static string GetTraceOutput() - { - // - // NOTE: Create a memory stream to capture all the trace output for - // this test. - // - MemoryStream memoryStream = new MemoryStream(); - - // - // NOTE: Create the trace listener using the memory stream we just - // created. - // - using (TraceListener listener = new TextWriterTraceListener( - memoryStream)) - { - // - // NOTE: Add the trace listener to the collection of active trace - // listeners (for this application domain). - // - Trace.Listeners.Add(listener); - - // - // NOTE: Attempt to lookup the type for the private SQLite3 class - // in the System.Data.SQLite assembly. We need the type in - // order to lookup the primary method used for this test (via - // reflection). This is only necessary because the method - // under test is private and cannot normally be executed from - // C# directly. If this fails, the following statement will - // throw a NullReferenceException, which is fine as that will - // cause the whole test to fail. - // - Type type = Type.GetType("System.Data.SQLite.SQLite3, " + - "System.Data.SQLite"); - - // - // NOTE: Attempt to lookup the method object for the private method - // we need for this test. If this fails, the first attempt - // to invoke the method using this variable will throw a - // NullReferenceException, which is fine as that will cause - // the whole test to fail. - // - MethodInfo methodInfo = type.GetMethod("StaticIsInitialized", - BindingFlags.Static | BindingFlags.NonPublic); - - // - // NOTE: Create the event that will be used to synchronize all the - // created threads so that they start doing their actual test - // "work" at approximately the same time. - // - using (ManualResetEvent goEvent = new ManualResetEvent(false)) - { - // - // NOTE: Create 4 threads for each processor on the machine. - // Under normal circumstances, this should give us a good - // chance of triggering the race condition being tested. - // - int count = 4 * Environment.ProcessorCount; - - // - // NOTE: Create a random number generator suitable for waiting a - // random number of milliseconds between each attempt to - // cause the race condition on a given thread. - // - Random random = new Random(); - - // - // NOTE: Create a (reusable) delegate that will contain the code - // that each created thread is to execute. - // - ThreadStart threadStart = delegate() - { - try - { - // - // NOTE: Wait forever for the "GO" signal so that all threads - // can start working at approximately the same time. - // - goEvent.WaitOne(); - - // - // NOTE: Force the SQLiteLog.StaticIsInitialized method to - // be repeatedly called on every thread right away to - // thoroughly test its locking semantics. Also, use a - // random delay, in milliseconds, between zero and the - // number of test threads squared after each attempt. - // - for (int index = 0; index < (count * count); index++) - { - methodInfo.Invoke(null, null); - Thread.Sleep(random.Next(0, (count * count))); - } - - // - // NOTE: Create and open a connection and use it to log a - // test message just to make sure that the logging - // system is initialized and in working order. - // - using (SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};")) - { - connection.Open(); - connection.LogMessage(0, "TEST ${id}"); - } - } - catch (Exception e) - { - // - // NOTE: We caught an exception. Since this will impact the - // captured trace output, this will cause the test to - // fail (just as it should). - // - Trace.WriteLine(String.Format("CAUGHT: {0}", e)); - } - }; - - // - // NOTE: Create the array of thread objects. - // - Thread\[\] thread = new Thread\[count\]; - - // - // NOTE: Create each of the test threads with a suitable stack - // size. We must specify a stack size here because the - // default one for the process would be the same as the - // parent executable (the Eagle shell), which is 16MB, - // too large to be useful. - // - for (int index = 0; index < count; index++) - { - thread\[index\] = new Thread(threadStart, 1048576); - - // - // NOTE: Name each thread for a better debugging experience. - // - thread\[index\].Name = String.Format( - "[file rootname ${fileName}] #{0}", index); - } - - // - // NOTE: Force logging to be initialized now; otherwise, there is - // no way for the native SQLite library to impact the trace - // listener we are monitoring for output. - // - SQLiteLog.Initialize(); - - // - // NOTE: Start all the threads now. They should not actually do - // any of the test "work" until we signal the event. - // - for (int index = 0; index < count; index++) - thread\[index\].Start(); - - // - // NOTE: Send the signal that all threads should start doing - // their test "work" now. - // - goEvent.Set(); /* GO */ - - // - // NOTE: Wait forever for each thread to finish its test "work" - // and then die. - // - for (int index = 0; index < count; index++) - thread\[index\].Join(); - } - - // - // NOTE: *REQUIRED* Force all the trace listeners to be flushed to - // disk now so that we do not lose any output. Without this - // method call, loss of trace output was observed. - // - Trace.Flush(); - - // - // NOTE: The trace listener used by this test can be removed now - // as all the trace output should have been flushed to the - // memory stream now. - // - Trace.Listeners.Remove(listener); - - // - // NOTE: Return a string containing all the trace output we saw - // (from all threads) during the above test code. - // - return Encoding.UTF8.GetString(memoryStream.ToArray()); - } - } - - /////////////////////////////////////////////////////////////////////// - - public static void Main() - { - // do nothing. - } - } - } - }] true true true results errors System.Data.SQLite.dll] - - list $code $results \ - [expr {[info exists errors] ? $errors : ""}] \ - [expr {$code eq "Ok" ? [catch { - object invoke _Dynamic${id}.Test${id} GetTraceOutput - } result] : [set result ""]}] [string map [list \r\n \n] $result] -} -cleanup { - cleanupDb $fileName - - unset -nocomplain result code results errors dataSource fileName -} -constraints {eagle configuration.Release monoBug28 command.sql compile.DATA\ -SQLite System.Data.SQLite} -match regexp -result [appendArgs "^Ok\ -System#CodeDom#Compiler#CompilerResults#\\d+ \\{\\} 0 \\{" [string repeat \ -"SQLite message \\(0\\): TEST $id -" [expr {4 * [info processors]}]] "\\}\$"]} - -############################################################################### - -unset -nocomplain id - -############################################################################### - -runSQLiteTestEpilogue -runTestEpilogue Index: Tests/tkt-7e3fa93744.eagle ================================================================== --- Tests/tkt-7e3fa93744.eagle +++ Tests/tkt-7e3fa93744.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -90,11 +90,11 @@ using System.Data; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) Index: Tests/tkt-84718e79fa.eagle ================================================================== --- Tests/tkt-84718e79fa.eagle +++ Tests/tkt-84718e79fa.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### Index: Tests/tkt-8554170e09.eagle ================================================================== --- Tests/tkt-8554170e09.eagle +++ Tests/tkt-8554170e09.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### Index: Tests/tkt-8b7d179c3c.eagle ================================================================== --- Tests/tkt-8b7d179c3c.eagle +++ Tests/tkt-8b7d179c3c.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -22,29 +22,17 @@ # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # -set systemDataSQLiteDllFile [getBuildFileName System.Data.SQLite.dll] -set systemDataSQLiteLinqDllFile [getBuildFileName System.Data.SQLite.Linq.dll] set testLinqExeFile [getBuildFileName testlinq.exe] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteDllFile -} - -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteLinqDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteLinqDllFile -} - if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile } if {![haveConstraint [appendArgs file_ [file tail $northwindEfDbFile]]]} then { @@ -79,32 +67,30 @@ } set result } -cleanup { unset -nocomplain code output error result pageSize -} -constraints {eagle monoToDo file_System.Data.SQLite.dll\ -file_System.Data.SQLite.Linq.dll file_testlinq.exe file_northwindEF.db} \ --result {0 {} 0 {DRACD RATTC OLDWO GALED LILAS MAGAA ALFKI CHOPS SAVEA KOENE\ +} -constraints {eagle monoToDo file_testlinq.exe file_northwindEF.db} -result \ +{0 {} 0 {DRACD RATTC OLDWO GALED LILAS MAGAA ALFKI CHOPS SAVEA KOENE MAISD\ +FOLKO CACTU OCEAN RANCH THECR GOURL GROSR SUPRD HUNGO ISLAT QUICK HUNGC GREAL\ +LEHMS RICSU ERNSH WILMK LINOD TRAIH SIMOB OTTIK SPLIR MORGK FOLIG FURIB PRINI\ +AROUT BSBEV CONSH EASTC NORTS SEVES BERGS VICTE BOLID FISSA ROMEY BLAUS BONAP\ +MEREP ANATR ANTON CENTC PERIC TORTU FRANK TOMSP DUMON FRANR WARTH PARIS SPECD\ +LONEP THEBI REGGC VINET WELLI HANAR QUEDE RICAR PICCO HILAA LETSS COMMI FAMIA\ +QUEEN TRADH WHITC GODOS SANTG BLONP WANDK FRANS LAMAI BOTTM LAUGB LACOR LAZYK\ +WOLZA VAFFE} 0 {DRACD RATTC OLDWO GALED LILAS MAGAA ALFKI CHOPS SAVEA KOENE\ MAISD FOLKO CACTU OCEAN RANCH THECR GOURL GROSR SUPRD HUNGO ISLAT QUICK HUNGC\ GREAL LEHMS RICSU ERNSH WILMK LINOD TRAIH SIMOB OTTIK SPLIR MORGK FOLIG FURIB\ PRINI AROUT BSBEV CONSH EASTC NORTS SEVES BERGS VICTE BOLID FISSA ROMEY BLAUS\ BONAP MEREP ANATR ANTON CENTC PERIC TORTU FRANK TOMSP DUMON FRANR WARTH PARIS\ SPECD LONEP THEBI REGGC VINET WELLI HANAR QUEDE RICAR PICCO HILAA LETSS COMMI\ FAMIA QUEEN TRADH WHITC GODOS SANTG BLONP WANDK FRANS LAMAI BOTTM LAUGB LACOR\ -LAZYK WOLZA VAFFE} 0 {DRACD RATTC OLDWO GALED LILAS MAGAA ALFKI CHOPS SAVEA\ -KOENE MAISD FOLKO CACTU OCEAN RANCH THECR GOURL GROSR SUPRD HUNGO ISLAT QUICK\ -HUNGC GREAL LEHMS RICSU ERNSH WILMK LINOD TRAIH SIMOB OTTIK SPLIR MORGK FOLIG\ -FURIB PRINI AROUT BSBEV CONSH EASTC NORTS SEVES BERGS VICTE BOLID FISSA ROMEY\ -BLAUS BONAP MEREP ANATR ANTON CENTC PERIC TORTU FRANK TOMSP DUMON FRANR WARTH\ -PARIS SPECD LONEP THEBI REGGC VINET WELLI HANAR QUEDE RICAR PICCO HILAA LETSS\ -COMMI FAMIA QUEEN TRADH WHITC GODOS SANTG BLONP WANDK FRANS LAMAI BOTTM LAUGB\ -LACOR LAZYK WOLZA VAFFE}}} +LAZYK WOLZA VAFFE}}} ############################################################################### -unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \ - testLinqExeFile northwindEfDbFile +unset -nocomplain testLinqExeFile northwindEfDbFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue DELETED Tests/tkt-996d13cd87.eagle Index: Tests/tkt-996d13cd87.eagle ================================================================== --- Tests/tkt-996d13cd87.eagle +++ /dev/null @@ -1,299 +0,0 @@ -############################################################################### -# -# tkt-996d13cd87.eagle -- -# -# Written by Joe Mistachkin. -# Released to the public domain, use at your own risk! -# -############################################################################### - -package require Eagle -package require Eagle.Library -package require Eagle.Test - -runTestPrologue - -############################################################################### - -package require System.Data.SQLite.Test -runSQLiteTestPrologue - -############################################################################### - -for {set i 1} {$i < 11} {incr i} { - set pooling [expr {$i % 2 == 0 ? True : False}] - set count [expr {$i <= 2 ? 100 : int(rand() * 100 + 1)}] - - runTest {test [appendArgs tkt-996d13cd87-1. $i] {SQLiteConnection stress} \ - -setup { - set fileName [appendArgs tkt-996d13cd87-1. $i .db] - - tputs $test_channel [appendArgs \ - "---- using a total of " $count " threads...\n"] - - if {[catch { - object invoke -flags +NonPublic \ - System.Data.SQLite.SQLiteConnectionPool _poolOpened 0 - - object invoke -flags +NonPublic \ - System.Data.SQLite.SQLiteConnectionPool _poolClosed 0 - }] == 0} then { - set havePoolCounts true - } else { - set havePoolCounts false - - tputs $test_channel \ - "==== WARNING: connection pool counts are not available\n" - } - - proc getPoolCounts {} { - # - # NOTE: If we have the ability to determine the opened/closed pool - # counts, fetch them now; otherwise, just set them to zero. - # - if {$::havePoolCounts} then { - set ::poolCounts(opened) [object invoke -flags +NonPublic \ - System.Data.SQLite.SQLiteConnectionPool _poolOpened] - - set ::poolCounts(closed) [object invoke -flags +NonPublic \ - System.Data.SQLite.SQLiteConnectionPool _poolClosed] - - tputs $::test_channel [appendArgs \ - "---- opened " $::poolCounts(opened) " connections from the pool\n"] - - tputs $::test_channel [appendArgs \ - "---- closed " $::poolCounts(closed) " connections to the pool\n"] - } else { - set ::poolCounts(opened) 0 - set ::poolCounts(closed) 0 - } - - return "" - } - } -body { - set id [object invoke Interpreter.GetActive NextId] - set dataSource [file join [getDatabaseDirectory] $fileName] - - set sql { \ - CREATE TABLE t1(x TEXT); \ - INSERT INTO t1 (x) VALUES(RANDOMBLOB(1000)); \ - } - - unset -nocomplain results errors - - set code [compileCSharpWith [subst { - using System; - using System.Data.SQLite; - using System.Diagnostics; - using System.Threading; - - namespace _Dynamic${id} - { - public static class Test${id} - { - public static int Main() - { - // - // NOTE: This is the total number of exceptions caught by all the - // test threads. - // - int errors = 0; - - // - // NOTE: This is the total number of test threads to create. - // - int count = ${count}; - - // - // NOTE: This is the total number of times we should force a full - // garbage collection. - // - int gcCount = 2; - - // - // NOTE: Create a random number generator suitable for waiting a - // random number of milliseconds between each attempt to - // cause the race condition on a given thread. - // - Random random = new Random(); - - // - // NOTE: Create the event that will be used to synchronize all the - // created threads so that they start doing their actual test - // "work" at approximately the same time. - // - using (ManualResetEvent goEvent = new ManualResetEvent(false)) - { - // - // NOTE: Create a (reusable) delegate that will contain the code - // that half the created threads are to execute. This code - // will repeatedly create, open, and close a single database - // connection with (or without) pooling enabled. - // - ThreadStart threadStart1 = delegate() - { - try - { - // - // NOTE: Wait forever for the "GO" signal so that all threads - // can start working at approximately the same time. - // - goEvent.WaitOne(); - - // - // NOTE: Repeatedly try to create, open, and close a pooled - // database connection and then wait a random number of - // milliseconds before doing it again. - // - Thread.Sleep(random.Next(0, 500)); - - SQLiteConnection connection = new SQLiteConnection( - "Data Source=${dataSource};Pooling=${pooling};"); - - connection.Open(); - - using (SQLiteCommand command = new SQLiteCommand("${sql}", - connection)) - { - command.ExecuteNonQuery(); - } - - connection.Close(); - connection = null; - } - catch (Exception e) - { - Interlocked.Increment(ref errors); - Trace.WriteLine(e); - } - }; - - // - // NOTE: Create a (reusable) delegate that will contain the code - // that half the created threads are to execute. This code - // will repeatedly force a full garbage collection. - // - ThreadStart threadStart2 = delegate() - { - try - { - // - // NOTE: Wait forever for the "GO" signal so that all threads - // can start working at approximately the same time. - // - goEvent.WaitOne(); - - // - // NOTE: Wait a random number of milliseconds before forcing - // a full garbage collection. - // - for (int index = 0; index < gcCount; index++) - { - Thread.Sleep(random.Next(0, 1000)); - GC.GetTotalMemory(true); - } - } - catch (Exception e) - { - Interlocked.Increment(ref errors); - Trace.WriteLine(e); - } - }; - - // - // NOTE: Create the array of thread objects. - // - Thread\[\] thread = new Thread\[count\]; - - // - // NOTE: Create each of the test threads with a suitable stack - // size. We must specify a stack size here because the - // default one for the process would be the same as the - // parent executable (the Eagle shell), which is 16MB, - // too large to be useful. - // - for (int index = 0; index < count; index++) - { - // - // NOTE: Figure out what kind of thread to create (i.e. one - // that uses a connection or one that calls the GC). - // - ThreadStart threadStart; - - if (index == 0) - threadStart = threadStart2; - else - threadStart = threadStart1; - - thread\[index\] = new Thread(threadStart, 1048576); - - // - // NOTE: Name each thread for a better debugging experience. - // - thread\[index\].Name = String.Format( - "[file rootname ${fileName}] #{0}", index); - } - - // - // NOTE: Start all the threads now. They should not actually do - // any of the test "work" until we signal the event. - // - for (int index = 0; index < count; index++) - thread\[index\].Start(); - - // - // NOTE: Send the signal that all threads should start doing - // their test "work" now. - // - goEvent.Set(); /* GO */ - - // - // NOTE: Wait forever for each thread to finish its test "work" - // and then die. - // - for (int index = 0; index < count; index++) - thread\[index\].Join(); - } - - // - // NOTE: Return the total number of exceptions caught by the test - // threads. - // - return errors; - } - } - } - }] true true true results errors System.Data.SQLite.dll] - - list $code $results \ - [expr {[info exists errors] ? $errors : ""}] \ - [expr {$code eq "Ok" ? [catch { - object invoke _Dynamic${id}.Test${id} Main - } result] : [set result ""]}] $result [getPoolCounts] \ - [expr {$havePoolCounts ? $pooling ? $poolCounts(opened) > 0 : \ - $poolCounts(opened) == 0} : True] \ - [expr {$havePoolCounts ? $pooling ? $poolCounts(closed) > 0 : \ - $poolCounts(closed) == 0} : True] - } -cleanup { - object invoke System.Data.SQLite.SQLiteConnection ClearAllPools - object invoke GC GetTotalMemory true - - cleanupDb $fileName - - unset -nocomplain result results errors code sql dataSource id db \ - poolCounts havePoolCounts fileName - - rename getPoolCounts "" - } -constraints {eagle monoBug28 command.sql compile.DATA\ -SQLite System.Data.SQLite} -match regexp -result {^Ok\ -System#CodeDom#Compiler#CompilerResults#\d+ \{\} 0 \d+ \{\} True True$}} -} - -############################################################################### - -unset -nocomplain count pooling i - -############################################################################### - -runSQLiteTestEpilogue -runTestEpilogue Index: Tests/tkt-ac47dd230a.eagle ================================================================== --- Tests/tkt-ac47dd230a.eagle +++ Tests/tkt-ac47dd230a.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -25,11 +25,11 @@ set appDomain($i) [object invoke AppDomain CreateDomain \ tkt-ac47dd230a-1.1.$i] set result null set interpreterHelper($i) [object invoke -alias InterpreterHelper \ - Create $appDomain($i) null Default Default null null null result] + Create $appDomain($i) null Default null null null result] if {[string length $interpreterHelper($i)] == 0} then { error [object invoke $result ToString] } @@ -46,12 +46,12 @@ set results [list] for {set i 1} {$i < 3} {incr i} { set result null set code [$interpreter($i) EvaluateScript { - package require Eagle.Library - package require Eagle.Test + package require EagleLibrary + package require EagleTest package require System.Data.SQLite.Test object load -loadtype File [file join [getBinaryDirectory] \ System.Data.SQLite.dll] @@ -65,13 +65,11 @@ set results } -cleanup { unset -nocomplain results code result interpreter interpreterHelper for {set i 1} {$i < 3} {incr i} { - if {[info exists appDomain($i)]} then { - object invoke AppDomain Unload $appDomain($i) - } + object invoke AppDomain Unload $appDomain($i) } unset -nocomplain appDomain i } -constraints {eagle monoBug28 command.sql compile.DATA\ compile.ISOLATED_INTERPRETERS SQLite System.Data.SQLite} -result {Ok 0 Ok 0}} Index: Tests/tkt-b4a7ddc83f.eagle ================================================================== --- Tests/tkt-b4a7ddc83f.eagle +++ Tests/tkt-b4a7ddc83f.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -37,12 +37,12 @@ set appDomainId(1) {[object invoke AppDomain.CurrentDomain Id]} set fileName {[appendArgs tkt-b4a7ddc83f-1. $i .db]} }] -body { set appDomainId(2) [object invoke AppDomain.CurrentDomain Id] - package require Eagle.Library - package require Eagle.Test + package require EagleLibrary + package require EagleTest package require System.Data.SQLite.Test object load -loadtype File [file join [getBinaryDirectory] \ System.Data.SQLite.dll] @@ -50,11 +50,10 @@ list $appDomainId(1) $appDomainId(2) \ [expr {$appDomainId(1) != $appDomainId(2)}] [setupDb $fileName] } -cleanup { cleanupDb $fileName - unset -nocomplain appDomainId db fileName } -constraints {eagle monoBug28 command.sql compile.DATA\ compile.ISOLATED_INTERPRETERS SQLite System.Data.SQLite} -isolationLevel \ AppDomain -match regexp -result {^\d+ \d+ True\ System#Data#SQLite#SQLiteConnection#\d+$}} Index: Tests/tkt-bb4b04d457.eagle ================================================================== --- Tests/tkt-bb4b04d457.eagle +++ Tests/tkt-bb4b04d457.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### Index: Tests/tkt-ccfa69fc32.eagle ================================================================== --- Tests/tkt-ccfa69fc32.eagle +++ Tests/tkt-ccfa69fc32.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -22,29 +22,17 @@ # # NOTE: Setup the variables that refer to the various files required by the # tests in this file. # -set systemDataSQLiteDllFile [getBuildFileName System.Data.SQLite.dll] -set systemDataSQLiteLinqDllFile [getBuildFileName System.Data.SQLite.Linq.dll] set testLinqExeFile [getBuildFileName testlinq.exe] set northwindEfDbFile [file nativename [file join [file dirname $path] \ testlinq northwindEF.db]] # # NOTE: Setup the test constraints specific to the tests in this file. # -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteDllFile -} - -if {![haveConstraint [appendArgs file_ \ - [file tail $systemDataSQLiteLinqDllFile]]]} then { - checkForFile $test_channel $systemDataSQLiteLinqDllFile -} - if {![haveConstraint [appendArgs file_ [file tail $testLinqExeFile]]]} then { checkForFile $test_channel $testLinqExeFile } if {![haveConstraint [appendArgs file_ [file tail $northwindEfDbFile]]]} then { @@ -79,21 +67,19 @@ } set result } -cleanup { unset -nocomplain code output error result add -} -constraints {eagle monoToDo file_System.Data.SQLite.dll\ -file_System.Data.SQLite.Linq.dll file_testlinq.exe file_northwindEF.db} -match \ +} -constraints {eagle monoToDo file_testlinq.exe file_northwindEF.db} -match \ glob -result {0 {1581 1730 1833 2116 2139} 0 {System.Data.UpdateException: *\ ---> System.Data.SQLite.SQLiteException: Abort due to constraint violation PRIMARY KEY must be unique *} 0 {1 2 3 4 5 6 7 8 9 10 1576 1577 1578 1579 1580 1581 1730 1833 2116 2139}}} ############################################################################### -unset -nocomplain systemDataSQLiteDllFile systemDataSQLiteLinqDllFile \ - testLinqExeFile northwindEfDbFile +unset -nocomplain testLinqExeFile northwindEfDbFile ############################################################################### runSQLiteTestEpilogue runTestEpilogue Index: Tests/tkt-e1b2e0f769.eagle ================================================================== --- Tests/tkt-e1b2e0f769.eagle +++ Tests/tkt-e1b2e0f769.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -29,11 +29,11 @@ foreach x [list 1 2 3] { sql execute $db "INSERT INTO t1 (x) VALUES($x);" } set result1 [list] - set dataSource [file join [getDatabaseDirectory] $fileName] + set dataSource [file join [getDatabaseDirectory] tkt-e1b2e0f769-1.1.db] foreach table [list t1 t2] { set id [object invoke Interpreter.GetActive NextId] set sql "SELECT x FROM $table ORDER BY x;" @@ -43,20 +43,17 @@ using System.Collections.Generic; using System.Data.SQLite; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { - public static List Tkt_e1b2e0f769( - SQLiteConnection connection - ) + public static List Tkt_e1b2e0f769(SQLiteConnection connection) { List result = new List(); - using (SQLiteTransaction transaction = - connection.BeginTransaction()) + using (SQLiteTransaction transaction = connection.BeginTransaction()) { using (SQLiteCommand command = connection.CreateCommand()) { command.CommandText = "${sql}"; @@ -92,12 +89,10 @@ connection.Close(); return result; } - ///////////////////////////////////////////////////////////////////// - public static int Main() { using (SQLiteConnection connection = new SQLiteConnection( "Data Source=${dataSource};")) { Index: Tests/tkt-e30b820248.eagle ================================================================== --- Tests/tkt-e30b820248.eagle +++ Tests/tkt-e30b820248.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -36,11 +36,11 @@ INSERT INTO t1 (id1) VALUES (1); \ INSERT INTO t1 (id1) VALUES (2); \ INSERT INTO t1 (id1) VALUES (?); \ INSERT INTO t1 (id1) VALUES (?); \ INSERT INTO t1 (id1) VALUES (?); \ - SELECT id1 FROM t1 ORDER BY id1; \ + SELECT * FROM t1 ORDER BY id1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { @@ -48,11 +48,11 @@ using System.Diagnostics; using System.IO; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { public static void Main() { using (TraceListener listener = new TextWriterTraceListener( new FileStream("${test_log}", FileMode.Append, @@ -105,11 +105,11 @@ } result] : [set result ""]}] $result \ [reportSQLiteResources $test_channel true] } -cleanup { cleanupDb $fileName - unset -nocomplain result code results errors sql name dataSource id fileName + unset -nocomplain result code results errors sql dataSource id db fileName } -constraints \ {eagle logFile monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} \ -match regexp -result [appendArgs "^Ok\ System#CodeDom#Compiler#CompilerResults#\\d+ \\{\\} 0 \\{\\} " $memory_used \$]} @@ -132,11 +132,11 @@ INSERT INTO t1 (id1) VALUES (1); \ INSERT INTO t1 (id1) VALUES (2); \ INSERT INTO t1 (id1) VALUES (3); \ INSERT INTO t1 (id1) VALUES (4); \ INSERT INTO t1 (id1) VALUES (5); \ - SELECT id1 FROM t1 ORDER BY id1; \ + SELECT * FROM t1 ORDER BY id1; \ } unset -nocomplain results errors set code [compileCSharpWith [subst { @@ -145,11 +145,11 @@ using System.Diagnostics; using System.IO; namespace _Dynamic${id} { - public static class Test${id} + public class Test${id} { #region Private Static Data private static SQLiteConnection connection; #endregion @@ -163,36 +163,30 @@ connection.LogMessage(0, "Connection opened."); } ///////////////////////////////////////////////////////////////////// - public static SQLiteCommand CreateCommand( - string sql - ) + public static SQLiteCommand CreateCommand(string sql) { SQLiteCommand command = connection.CreateCommand(); command.CommandText = sql; connection.LogMessage(0, "Command created."); return command; } ///////////////////////////////////////////////////////////////////// - public static SQLiteDataReader ExecuteReader( - SQLiteCommand command - ) + public static SQLiteDataReader ExecuteReader(SQLiteCommand command) { SQLiteDataReader dataReader = command.ExecuteReader(); connection.LogMessage(0, "Command executed."); return dataReader; } ///////////////////////////////////////////////////////////////////// - public static SQLiteDataReader ExecuteReader( - string sql - ) + public static SQLiteDataReader ExecuteReader(string sql) { SQLiteCommand command = CreateCommand(sql); SQLiteDataReader dataReader = command.ExecuteReader(); connection.LogMessage(0, "Command executed."); return dataReader; @@ -258,11 +252,11 @@ } result] : [set result ""]}] $result \ [reportSQLiteResources $test_channel true] } -cleanup { cleanupDb $fileName - unset -nocomplain result code results errors sql name dataSource id \ + unset -nocomplain result code results errors sql name dataSource id db \ fileName } -constraints {eagle logFile monoBug28 command.sql compile.DATA SQLite\ System.Data.SQLite} -match regexp -result [appendArgs "^Ok\ System#CodeDom#Compiler#CompilerResults#\\d+ \\{\\} 0 \\{\\} " $memory_used \$]} } Index: Tests/version.eagle ================================================================== --- Tests/version.eagle +++ Tests/version.eagle @@ -6,12 +6,12 @@ # Released to the public domain, use at your own risk! # ############################################################################### package require Eagle -package require Eagle.Library -package require Eagle.Test +package require EagleLibrary +package require EagleTest runTestPrologue ############################################################################### @@ -27,11 +27,11 @@ # numbers must be manually kept synchronized with the version numbers for # the source code files, the built binaries, and the release packages. # set version(major) 1 set version(minor) 0 -set version(build) 81; # NOTE: Incremented with each release. +set version(build) 78; # NOTE: Incremented with each release. set version(revision) 0 ############################################################################### # ********************* END VOLATILE VERSION INFORMATION ********************** ############################################################################### @@ -159,13 +159,10 @@ [appendArgs [string map [list . \\.] \ $version(full)] ] \ [appendArgs Value=\" [format %03d $version(build)] \"] \ [appendArgs Value=\" [string map [list . \\.] $version(full)] \"] \ [appendArgs Value=\" [string map [list . ,] $version(full)] \"] \ - [appendArgs Value=\" [format %03d $version(build)] \"] \ - [appendArgs Value=\" [string map [list . \\.] $version(full)] \"] \ - [appendArgs Value=\" [string map [list . ,] $version(full)] \"] \ [appendArgs [format %03d $version(build)] \ ] \ [appendArgs [string map [list . \\.] \ $version(full)] ] \ [appendArgs [string map [list . ,] \ @@ -212,19 +209,16 @@ [file join Membership Properties AssemblyInfo.cs] \ [file join Membership Properties AssemblyInfo.cs] \ [file join SQLite.Designer AssemblyInfo.cs] \ [file join SQLite.Designer AssemblyInfo.cs] \ [file join SQLite.Designer source.extension.vsixmanifest] \ - [file join SQLite.Interop props SQLite.Interop.2005.vsprops] \ - [file join SQLite.Interop props SQLite.Interop.2005.vsprops] \ - [file join SQLite.Interop props SQLite.Interop.2005.vsprops] \ - [file join SQLite.Interop props SQLite.Interop.2008.vsprops] \ - [file join SQLite.Interop props SQLite.Interop.2008.vsprops] \ - [file join SQLite.Interop props SQLite.Interop.2008.vsprops] \ - [file join SQLite.Interop props SQLite.Interop.2010.props] \ - [file join SQLite.Interop props SQLite.Interop.2010.props] \ - [file join SQLite.Interop props SQLite.Interop.2010.props] \ + [file join SQLite.Interop props SQLite.Interop.vsprops] \ + [file join SQLite.Interop props SQLite.Interop.vsprops] \ + [file join SQLite.Interop props SQLite.Interop.vsprops] \ + [file join SQLite.Interop props SQLite.Interop.props] \ + [file join SQLite.Interop props SQLite.Interop.props] \ + [file join SQLite.Interop props SQLite.Interop.props] \ [file join SQLite.Interop src win interop.h] \ [file join System.Data.SQLite AssemblyInfo.cs] \ [file join System.Data.SQLite AssemblyInfo.cs] \ [file join System.Data.SQLite SQLite3.cs] \ [file join System.Data.SQLite UnsafeNativeMethods.cs] \ Index: exclude_bin.txt ================================================================== --- exclude_bin.txt +++ exclude_bin.txt @@ -1,6 +1,5 @@ -*.done *.exp *.lib *.map *EnvDTE.* *Microsoft.* Index: readme.htm ================================================================== --- readme.htm +++ readme.htm @@ -3,12 +3,12 @@ ADO.NET SQLite Data Provider
    -Version 1.0.81.0 June XX, 2012 (release scheduled)
    -Using SQLite 3.7.11
    +Version 1.0.78.0 January XX, 2012
    +Using SQLite 3.7.10
    Originally written by Robert Simpson
    Released to the public domain, use at your own risk!
    Official provider website: http://system.data.sqlite.org/
    Legacy versions: http://sqlite.phxsoftware.com/

    @@ -144,11 +144,11 @@ <configuration> <system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite" /> <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" - type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.81.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> + type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.78.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" /> </DbProviderFactories> </system.data> </configuration>

    @@ -185,70 +185,15 @@

    Version History

    - 1.0.81.0 - June XX, 2012 -

    -
      -
    • Updated to SQLite 3.7.12.
    • -
    • Support compiling the interop assembly without support for the custom extension functions and the CryptoAPI based codec.
    • -
    • Add DefineConstants property to the SQLiteConnection class to return the list of define constants used when compiling the core managed assembly.
    • -
    • Add release archive verification tool to the release automation.
    • -
    • Fix subtle race condition between threads fetching connection handles from the connection pool any garbage collection (GC) threads that may be running. Fix for [996d13cd87].
    • -
    • Add missing call to SetTimeout in the SQLite3_UTF16.Open method.
    • -
    • Add checks to prevent the SQLiteConnectionPool.Remove method from returning any connection handles that are closed or invalid.
    • -
    • Modify static SQLiteBase helper methods to prevent them from passing IntPtr.Zero to the SQLite native library.
    • -
    • Remove static locks from the static helper methods in the SQLiteBase class, replacing them with a lock on the connection handle instance being operated upon.
    • -
    • Revise CriticalHandle derived classes to make them more thread-safe.
    • -
    • Add connection pool related diagnostic messages when compiled with the DEBUG define constant.
    • -
    • Add PoolCount property to the SQLiteConnection class to return the number of pool entries for the file name associated with the connection.
    • -
    • Rename internal SQLiteLastError methods to GetLastError.
    • -
    • Add assembly file test constraints to all tests that execute the "test.exe" or "testlinq.exe" files.
    • -
    -

    - 1.0.80.0 - April 1, 2012 -

    -
      -
    • Updated to SQLite 3.7.11.
    • -
    • In the SQLiteFunction class, when calling user-provided methods from a delegate called by native code, avoid throwing exceptions, optionally tracing the caught exceptions. Fix for [8a426d12eb].
    • -
    • Add Visual Studio 2005 support to all the applicable solution/project files, their associated supporting files, and the test suite.
    • -
    • Add Visual Studio 2005 support to the redesigned designer support installer.
    • -
    • Add experimental support for "pre-loading" the native SQLite library based on the processor architecture of the current process. This feature is now enabled by default at compile-time.
    • -
    • Add support for the native SQLite Online Backup API. Fix for [c71846ed57].
    • -
    • Acquire and hold a static data lock while checking if the native SQLite library has been initialized to prevent a subtle race condition that can result in superfluous error messages. Fix for [72905c9a77].
    • -
    • Support tracing of all parameter binding activity and use the connection flags to control what is traced.
    • -
    • When converting a DateTime instance of an "Unspecified" kind to a string, use the same kind as the connection, if available.
    • -
    • Add overload of the SQLiteDataReader.GetValues method that returns a NameValueCollection.
    • -
    • Add static ToUnixEpoch method to the SQLiteConvert class to convert a DateTime value to the number of whole seconds since the Unix epoch.
    • -
    • In the implicit conversion operators (to IntPtr) for both the SQLiteConnectionHandle and SQLiteStatementHandle classes, return IntPtr.Zero if the instance being converted is null.
    • -
    • Write warning message to the active trace listeners (for the Debug build configuration only) if a column type or type name cannot be mapped properly. See [4bbf851fa5].
    • -
    • When tracing SQL statements to be prepared, bypass the internal length limit of the sqlite3_log function by using the SQLiteLog class directly instead. Also, detect null and/or empty strings and emit a special message in that case.
    • -
    • For the setup, the Visual Studio task should only be initially checked if the GAC task is available and vice-versa.
    • -
    • Improve compatibility with custom command processors by using __ECHO instead of _ECHO in batch tools.
    • -
    • Add OpenAndReturn method to the SQLiteConnection class to open a connection and return it.
    • -
    • Add missing CheckDisposed calls to the SQLiteConnection class.
    • -
    • Add missing throw statement to the SQLiteConnection class.
    • -
    • Make sure the interop project uses /fp:precise for Windows CE.
    • -
    • Regenerate package load key to support loading the designer package into Visual Studio 2008 without having the matching SDK installed.
    • -
    • Modify transaction object disposal so that it can never cause an exception to be thrown.
    • -
    -

    - 1.0.79.0 - January 28, 2012 -

    -
      -
    • Use the WoW64 registry keys when installing the VS designer components on 64-bit Windows. Fix for [d8491abd0b].
    • -
    • Correct resource name used by the LINQ assembly to locate several key string resources. Fix for [fbebb30da9].
    • -
    -

    - 1.0.78.0 - January 27, 2012 + 1.0.78.0 - January XX, 2012

    • Updated to SQLite 3.7.10.
    • Redesign the VS designer support installer and integrate it into the setup packages.
    • -
    • When emitting SQL for foreign keys in the VS designer, be sure to take all returned schema rows into account. Remainder of fix for [b226147b37].
    • -
    • Add Flags connection string property to control extra behavioral flags for the connection.
    • Refactor all IDisposable implementations to conform to best practices, potentially eliminating leaks in certain circumstances.
    • Even more enhancements to the build and test automation.
    • Support parameter binding to more primitive types, including unsigned integer types.
    • Recognize the TIMESTAMP column data type as the DateTime type. Fix for [bb4b04d457].
    • Prevent logging superfluous messages having to do with library initialization checking. Fix for [3fc172d1be].
    • Index: test/AssemblyInfo.cs ================================================================== --- test/AssemblyInfo.cs +++ test/AssemblyInfo.cs @@ -36,7 +36,7 @@ // Major Version // Minor Version // Build Number // Revision // -[assembly: AssemblyVersion("1.0.81.0")] -[assembly: AssemblyFileVersion("1.0.81.0")] +[assembly: AssemblyVersion("1.0.78.0")] +[assembly: AssemblyFileVersion("1.0.78.0")] Index: test/TestCases.cs ================================================================== --- test/TestCases.cs +++ test/TestCases.cs @@ -77,11 +77,10 @@ { if (_fact.GetType().Name.IndexOf("SQLite", StringComparison.OrdinalIgnoreCase) == -1) throw new InconclusiveException("Not a SQLite database"); } -#if INTEROP_CODEC /// /// Tests changing password on an encrypted database. /// [Test] internal void ChangePasswordTest() @@ -146,11 +145,10 @@ cnn.Open(); cnn.Close(); } } -#endif [Test(Sequence=1)] internal string VersionTest() { CheckSQLite(); @@ -219,11 +217,10 @@ reader.Read(); } } } -#if INTEROP_EXTENSION_FUNCTIONS [Test(Sequence = 8)] internal void FunctionWithCollation() { CheckSQLite(); using (DbCommand cmd = _cnn.CreateCommand()) @@ -235,11 +232,10 @@ if (reader.GetInt64(0) != reader.GetInt64(2) || reader.GetInt64(1) != 0 || reader.GetInt64(0) != 4) throw new Exception("CharIndex returned wrong results!"); } } } -#endif [Test(Sequence = 9)] internal void FunctionWithCollation2() { CheckSQLite(); @@ -1202,14 +1198,10 @@ { adp.SelectCommand = cmd; builder.DataAdapter = adp; builder.ConflictOption = ConflictOption.OverwriteChanges; - // - // NOTE: *MONO* This test fails on all recent versions of Mono (e.g. - // 2.10, 2.11) for reasons that are presently unknown. - // using (DbCommand updatecmd = builder.GetUpdateCommand()) { if (updatecmd.Parameters.Count != 4) throw new Exception("Wrong number of parameters in update command!"); } Index: test/app.config ================================================================== --- test/app.config +++ test/app.config @@ -1,8 +1,8 @@ - + DELETED test/test.2005.csproj Index: test/test.2005.csproj ================================================================== --- test/test.2005.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {E27B1B1E-19C0-45E8-AA74-B6E1C041A130} - Properties - Exe - test - test - $(MSBuildProjectDirectory)\.. - true - 2005 - - - - $(BinaryOutputPath) - - - true - full - false - DEBUG;TRACE - prompt - - - pdbonly - true - TRACE - prompt - - - - {AC139952-261A-4463-B6FA-AEBC25283A66} - System.Data.SQLite.2005 - False - - - - - - - - - - - - - - - True - True - Resources.resx - - - - Form - - - TestCasesDialog.cs - - - - - ResXFileCodeGenerator - Resources.Designer.cs - - - TestCasesDialog.cs - - - - - - - - Index: testce/AssemblyInfo.cs ================================================================== --- testce/AssemblyInfo.cs +++ testce/AssemblyInfo.cs @@ -36,8 +36,8 @@ // Major Version // Minor Version // Build Number // Revision // -[assembly: AssemblyVersion("1.0.81.0")] -// [assembly: AssemblyFileVersion("1.0.81.0")] +[assembly: AssemblyVersion("1.0.78.0")] +// [assembly: AssemblyFileVersion("1.0.78.0")] DELETED testce/testce.2005.csproj Index: testce/testce.2005.csproj ================================================================== --- testce/testce.2005.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {B86CE504-C4E4-496F-A0F0-E613BCFD3DF7} - WinExe - Properties - test - testce - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - WindowsCE - E2BECB1F-8C8C-41ba-B736-9BE7D946A398 - 5.0 - v2.0 - Windows CE - - $(MSBuildProjectDirectory)\.. - true - 2005 - Compact - testce - %25CSIDL_PROGRAM_FILES%25 - - - - $(BinaryOutputPath) - - - true - full - false - DEBUG;TRACE;$(PlatformFamilyName) - true - true - prompt - off - - - pdbonly - true - TRACE;$(PlatformFamilyName) - true - true - prompt - off - - - - - False - - - False - - - False - - - False - - - False - - - - - - Form - - - Form1.cs - - - - - - - - Form1.cs - Designer - - - - - {AC139951-261A-4463-B6FA-AEBC25283A66} - System.Data.SQLite.Compact.2005 - - - - - - - - - - - - - Index: testlinq/2008/App.config ================================================================== --- testlinq/2008/App.config +++ testlinq/2008/App.config @@ -1,11 +1,11 @@ - + Index: testlinq/2010/App.config ================================================================== --- testlinq/2010/App.config +++ testlinq/2010/App.config @@ -1,11 +1,11 @@ - + Index: testlinq/Properties/AssemblyInfo.cs ================================================================== --- testlinq/Properties/AssemblyInfo.cs +++ testlinq/Properties/AssemblyInfo.cs @@ -39,7 +39,7 @@ // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.81.0")] -[assembly: AssemblyFileVersion("1.0.81.0")] +[assembly: AssemblyVersion("1.0.78.0")] +[assembly: AssemblyFileVersion("1.0.78.0")] Index: testlinq/testlinq.2008.csproj ================================================================== --- testlinq/testlinq.2008.csproj +++ testlinq/testlinq.2008.csproj @@ -72,11 +72,11 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {A41FE2A5-07AD-4CE7-B836-1544634816F5} - Properties - Exe - Installer - Installer - true - $(MSBuildProjectDirectory)\..\.. - true - 2005 - - - - - $(BinaryOutputPath) - - - true - full - false - DEBUG;TRACE - prompt - - - pdbonly - true - TRACE - prompt - - - - - - - - - - - - - - - - - - $(BuildDependsOn); - EmbedExeManifest; - StrongNameSign; - - - - Index: tools/install/Installer.cs ================================================================== --- tools/install/Installer.cs +++ tools/install/Installer.cs @@ -33,11 +33,10 @@ string name, string description, string typeName, AssemblyName assemblyName, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref bool saved, ref string error @@ -49,11 +48,10 @@ Installer.MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ); @@ -63,11 +61,10 @@ internal delegate bool VisualStudioRegistryCallback( Installer.MockRegistryKey rootKey, Version vsVersion, Installer.Package package, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ); @@ -230,11 +227,10 @@ #endregion /////////////////////////////////////////////////////////////////// #region Interactive Support Methods - [MethodImpl(MethodImplOptions.NoInlining)] public static DialogResult ShowMessage( TracePriority tracePriority, TraceCallback debugCallback, TraceCallback traceCallback, Assembly assembly, @@ -1373,11 +1369,10 @@ #endregion /////////////////////////////////////////////////////////////////// #region Public Static Methods - [MethodImpl(MethodImplOptions.NoInlining)] public static MockRegistryKey OpenSubKey( MockRegistryKey rootKey, string subKeyName, bool writable, bool whatIf, @@ -1406,11 +1401,10 @@ new MockRegistryKey(key, whatIf, false, false) : null; } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static MockRegistryKey CreateSubKey( MockRegistryKey rootKey, string subKeyName, bool whatIf, bool verbose @@ -1459,11 +1453,10 @@ } } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static void DeleteSubKey( MockRegistryKey rootKey, string subKeyName, bool throwOnMissing, bool whatIf, @@ -1486,11 +1479,10 @@ subKeysDeleted++; } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static void DeleteSubKeyTree( MockRegistryKey rootKey, string subKeyName, bool whatIf, bool verbose @@ -1512,11 +1504,10 @@ subKeysDeleted++; } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static string[] GetSubKeyNames( MockRegistryKey key, bool whatIf, bool verbose ) @@ -1532,11 +1523,10 @@ return key.GetSubKeyNames(); } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static object GetValue( MockRegistryKey key, string name, object defaultValue, bool whatIf, @@ -1556,11 +1546,10 @@ return key.GetValue(name, defaultValue); } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static void SetValue( MockRegistryKey key, string name, object value, bool whatIf, @@ -1583,11 +1572,10 @@ keyValuesSet++; } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static void DeleteValue( MockRegistryKey key, string name, bool throwOnMissing, bool whatIf, @@ -1769,17 +1757,15 @@ string traceFormat, InstallFlags installFlags, TracePriority debugPriority, TracePriority tracePriority, bool install, - bool wow64, bool noRuntimeVersion, bool noDesktop, bool noCompact, bool noNetFx20, bool noNetFx40, - bool noVs2005, bool noVs2008, bool noVs2010, bool noTrace, bool noConsole, bool noLog, @@ -1800,17 +1786,15 @@ this.traceFormat = traceFormat; this.installFlags = installFlags; this.debugPriority = debugPriority; this.tracePriority = tracePriority; this.install = install; - this.wow64 = wow64; this.noRuntimeVersion = noRuntimeVersion; this.noDesktop = noDesktop; this.noCompact = noCompact; this.noNetFx20 = noNetFx20; this.noNetFx40 = noNetFx40; - this.noVs2005 = noVs2005; this.noVs2008 = noVs2008; this.noVs2010 = noVs2010; this.noTrace = noTrace; this.noConsole = noConsole; this.noLog = noLog; @@ -1966,17 +1950,16 @@ return new Configuration(thisAssembly, null, directory, coreFileName, linqFileName, designerFileName, TraceOps.DebugFormat, TraceOps.TraceFormat, InstallFlags.Default, TracePriority.Default, TracePriority.Default, true, false, false, false, false, - false, false, false, false, false, false, false, false, - true, true, false, false, false); + false, false, false, false, false, false, true, true, + false, false, false); } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static bool FromArgs( string[] args, bool strict, ref Configuration configuration, ref string error @@ -2402,31 +2385,10 @@ continue; } configuration.noTrace = (bool)value; } - else if (MatchOption(newArg, "noVs2005")) - { - bool? value = ParseBoolean(text); - - if (value == null) - { - error = TraceOps.DebugAndTrace( - TracePriority.Lowest, debugCallback, - traceCallback, String.Format( - "Invalid {0} boolean value: {1}", - ForDisplay(arg), ForDisplay(text)), - traceCategory); - - if (strict) - return false; - - continue; - } - - configuration.noVs2005 = (bool)value; - } else if (MatchOption(newArg, "noVs2008")) { bool? value = ParseBoolean(text); if (value == null) @@ -2582,31 +2544,10 @@ continue; } configuration.whatIf = (bool)value; } - else if (MatchOption(newArg, "wow64")) - { - bool? value = ParseBoolean(text); - - if (value == null) - { - error = TraceOps.DebugAndTrace( - TracePriority.Lowest, debugCallback, - traceCallback, String.Format( - "Invalid {0} boolean value: {1}", - ForDisplay(arg), ForDisplay(text)), - traceCategory); - - if (strict) - return false; - - continue; - } - - configuration.wow64 = (bool)value; - } else { error = TraceOps.DebugAndTrace( TracePriority.Lowest, debugCallback, traceCallback, String.Format( @@ -2631,11 +2572,10 @@ return false; } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static bool Process( string[] args, Configuration configuration, bool strict, ref string error @@ -2737,15 +2677,10 @@ TraceOps.DebugAndTrace(TracePriority.MediumLow, debugCallback, traceCallback, String.Format( "Original command line is: {0}", Environment.CommandLine), traceCategory); - TraceOps.DebugAndTrace(TracePriority.MediumLow, - debugCallback, traceCallback, String.Format( - "Running process is {0}.", Is64BitProcess() ? - "64-bit" : "32-bit"), traceCategory); - if (!configuration.whatIf) { // // NOTE: If the debugger is attached and What-If mode // is [now] disabled, issue a warning. @@ -2794,11 +2729,10 @@ return false; } /////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] public static bool CheckRuntimeVersion( Configuration configuration, bool strict, ref string error ) @@ -2848,11 +2782,11 @@ error = "invalid core file image runtime version"; return false; } else if (String.Equals( coreImageRuntimeVersion, CLRv2ImageRuntimeVersion, - StringComparison.Ordinal)) + StringComparison.InvariantCulture)) { // // NOTE: For the CLR v2.0 runtime, make sure we disable // any attempt to use it for things that require // an assembly compiled for the CLR v4.0. It is @@ -2872,19 +2806,18 @@ CLRv2ImageRuntimeVersion, CLRv4ImageRuntimeVersion), traceCategory); } else if (String.Equals( coreImageRuntimeVersion, CLRv4ImageRuntimeVersion, - StringComparison.Ordinal)) + StringComparison.InvariantCulture)) { // // NOTE: For the CLR v4.0 runtime, make sure we disable // any attempt to use it for things that require // an assembly compiled for the CLR v2.0. // configuration.noNetFx20 = true; - configuration.noVs2005 = true; configuration.noVs2008 = true; TraceOps.DebugAndTrace(TracePriority.Medium, debugCallback, traceCallback, String.Format( "Assembly is compiled for the .NET Framework {0}, " + @@ -2987,14 +2920,10 @@ traceCallback(String.Format(NameAndValueFormat, "Install", ForDisplay(install)), traceCategory); - traceCallback(String.Format(NameAndValueFormat, - "Wow64", ForDisplay(wow64)), - traceCategory); - traceCallback(String.Format(NameAndValueFormat, "NoRuntimeVersion", ForDisplay(noRuntimeVersion)), traceCategory); traceCallback(String.Format(NameAndValueFormat, @@ -3011,14 +2940,10 @@ traceCallback(String.Format(NameAndValueFormat, "NoNetFx40", ForDisplay(noNetFx40)), traceCategory); - traceCallback(String.Format(NameAndValueFormat, - "NoVs2005", ForDisplay(noVs2005)), - traceCategory); - traceCallback(String.Format(NameAndValueFormat, "NoVs2008", ForDisplay(noVs2008)), traceCategory); traceCallback(String.Format(NameAndValueFormat, @@ -3184,19 +3109,10 @@ set { install = value; } } /////////////////////////////////////////////////////////////////// - private bool wow64; - public bool Wow64 - { - get { return wow64; } - set { wow64 = value; } - } - - /////////////////////////////////////////////////////////////////// - private bool noRuntimeVersion; public bool NoRuntimeVersion { get { return noRuntimeVersion; } set { noRuntimeVersion = value; } @@ -3236,19 +3152,10 @@ { get { return noNetFx40; } set { noNetFx40 = value; } } - /////////////////////////////////////////////////////////////////// - - private bool noVs2005; - public bool NoVs2005 - { - get { return noVs2005; } - set { noVs2005 = value; } - } - /////////////////////////////////////////////////////////////////// private bool noVs2008; public bool NoVs2008 { @@ -3450,30 +3357,16 @@ private const string NameAndValueFormat = "{0}: {1}"; private const string LogFileSuffix = ".log"; /////////////////////////////////////////////////////////////////////// - private const string RootKeyName = "Software"; - private const string Wow64SubKeyName = "Wow6432Node"; - - /////////////////////////////////////////////////////////////////////// - - // - // NOTE: The .NET Framework has both 32-bit and 64-bit editions. - // - private static readonly bool NetFxIs32BitOnly = false; - - /////////////////////////////////////////////////////////////////////// - - // - // NOTE: For now, Visual Studio is always a 32-bit application. - // - private static readonly bool VsIs32BitOnly = true; - - /////////////////////////////////////////////////////////////////////// - private static readonly string VsIdFormat = "B"; + + /////////////////////////////////////////////////////////////////////// + + private static readonly string FrameworkKeyName = + "Software\\Microsoft\\.NETFramework"; /////////////////////////////////////////////////////////////////////// private static readonly string XPathForAddElement = "configuration/system.data/DbProviderFactories/add[@invariant=\"{0}\"]"; @@ -3536,37 +3429,10 @@ { TraceOps.TraceCore(String.Format( TraceOps.TraceFormat, TraceOps.NextTraceId(), TraceOps.TimeStamp(DateTime.UtcNow), message), category); } - #endregion - - /////////////////////////////////////////////////////////////////////// - - #region Generic Platform Handling - private static bool Is64BitProcess() - { - // - // NOTE: Returns true if the current process is 64-bit. If this - // is true, we *know* that we must be running on a 64-bit - // operating system as well. However, if this is false, we - // do not necessarily know that we are running on a 32-bit - // operating system, due to WoW64 (Win32-on-Win64), etc. - // - return (IntPtr.Size == sizeof(long)); // NOTE: Pointer is 64-bits? - } - - /////////////////////////////////////////////////////////////////////// - - private static string GetRootKeyName( - bool wow64 - ) - { - return String.Format("{0}{1}", RootKeyName, - wow64 && Is64BitProcess() ? - "\\" + Wow64SubKeyName : String.Empty); - } #endregion /////////////////////////////////////////////////////////////////////// #region Generic String Handling @@ -3672,37 +3538,10 @@ #endregion /////////////////////////////////////////////////////////////////////// #region .NET Framework Handling - private static string GetFrameworkRootKeyName( - bool wow64 - ) - { - return String.Format("{0}\\Microsoft\\.NETFramework", - GetRootKeyName(wow64)); - } - - /////////////////////////////////////////////////////////////////////// - - private static string GetFrameworkKeyName( - string frameworkName, - Version frameworkVersion, - string platformName, - bool wow64 - ) - { - string format = !String.IsNullOrEmpty(platformName) ? - "{0}\\Microsoft\\{1}\\v{2}\\{3}" : - "{0}\\Microsoft\\{1}\\v{2}"; - - return String.Format(format, GetRootKeyName(wow64), - frameworkName, frameworkVersion, platformName); - } - - /////////////////////////////////////////////////////////////////////// - private static string GetImageRuntimeVersion( string fileName ) { try @@ -3724,18 +3563,16 @@ /////////////////////////////////////////////////////////////////////// private static string GetFrameworkDirectory( MockRegistryKey rootKey, Version frameworkVersion, - bool wow64, bool whatIf, bool verbose ) { using (MockRegistryKey key = RegistryHelper.OpenSubKey( - rootKey, GetFrameworkRootKeyName(wow64), false, - whatIf, verbose)) + rootKey, FrameworkKeyName, false, whatIf, verbose)) { if (key == null) return null; object value = RegistryHelper.GetValue( @@ -3834,17 +3671,20 @@ private static bool HaveFramework( MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, - bool wow64, bool whatIf, bool verbose ) { - string keyName = GetFrameworkKeyName( - frameworkName, frameworkVersion, platformName, wow64); + string format = !String.IsNullOrEmpty(platformName) ? + "Software\\Microsoft\\{0}\\v{1}\\{2}" : + "Software\\Microsoft\\{0}\\v{1}"; + + string keyName = String.Format( + format, frameworkName, frameworkVersion, platformName); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) @@ -3852,31 +3692,24 @@ if (platformName != null) // NOTE: Skip non-desktop. return true; string directory = GetFrameworkDirectory( - rootKey, frameworkVersion, wow64, whatIf, verbose); + rootKey, frameworkVersion, whatIf, verbose); if (String.IsNullOrEmpty(directory)) return false; if (!Directory.Exists(directory)) return false; - TraceOps.DebugAndTrace(TracePriority.Lower, - debugCallback, traceCallback, String.Format( - ".NET Framework {0} found in directory {1}.", - ForDisplay(frameworkVersion), ForDisplay(directory)), - traceCategory); - return true; } } /////////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] private static bool ForEachFrameworkConfig( MockRegistry registry, FrameworkList frameworkList, FrameworkConfigCallback callback, string invariant, @@ -3883,11 +3716,10 @@ string name, string description, string typeName, AssemblyName assemblyName, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref bool saved, ref string error @@ -3985,11 +3817,11 @@ ForDisplay(frameworkVersion), ForDisplay(platformName)), traceCategory); if (!HaveFramework( rootKey, frameworkName, frameworkVersion, - platformName, wow64, whatIf, verbose)) + platformName, whatIf, verbose)) { TraceOps.DebugAndTrace(TracePriority.Low, debugCallback, traceCallback, ".NET Framework not found, skipping...", traceCategory); @@ -3999,11 +3831,11 @@ if (callback == null) continue; string directory = GetFrameworkDirectory( - rootKey, frameworkVersion, wow64, whatIf, verbose); + rootKey, frameworkVersion, whatIf, verbose); if (String.IsNullOrEmpty(directory)) { TraceOps.DebugAndTrace(TracePriority.Low, debugCallback, traceCallback, String.Format( @@ -4042,12 +3874,12 @@ bool localSaved = false; if (!callback( fileName, invariant, name, description, typeName, - assemblyName, clientData, wow64, throwOnMissing, - whatIf, verbose, ref localSaved, ref error)) + assemblyName, clientData, throwOnMissing, whatIf, + verbose, ref localSaved, ref error)) { return false; } else { @@ -4067,17 +3899,15 @@ return true; } /////////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] private static bool ForEachFrameworkRegistry( MockRegistry registry, FrameworkList frameworkList, FrameworkRegistryCallback callback, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) @@ -4167,11 +3997,11 @@ ForDisplay(frameworkVersion), ForDisplay(platformName)), traceCategory); if (!HaveFramework( rootKey, frameworkName, frameworkVersion, - platformName, wow64, whatIf, verbose)) + platformName, whatIf, verbose)) { TraceOps.DebugAndTrace(TracePriority.Low, debugCallback, traceCallback, ".NET Framework not found, skipping...", traceCategory); @@ -4182,11 +4012,11 @@ if (callback == null) continue; if (!callback( rootKey, frameworkName, frameworkVersion, - platformName, clientData, wow64, throwOnMissing, + platformName, clientData, throwOnMissing, whatIf, verbose, ref error)) { return false; } } @@ -4213,12 +4043,11 @@ if (vsList.Versions == null) { vsList.Versions = new VersionList(); - if ((configuration == null) || !configuration.NoVs2005) - vsList.Versions.Add(new Version(8, 0)); // Visual Studio 2005 + // vsList.Versions.Add(new Version(8, 0)); // Visual Studio 2005 if ((configuration == null) || !configuration.NoVs2008) vsList.Versions.Add(new Version(9, 0)); // Visual Studio 2008 if ((configuration == null) || !configuration.NoVs2010) @@ -4229,19 +4058,19 @@ /////////////////////////////////////////////////////////////////////// private static bool HaveVsVersion( MockRegistryKey rootKey, Version vsVersion, - bool wow64, bool whatIf, bool verbose ) { if (vsVersion == null) return false; - string keyName = GetVsKeyName(vsVersion, wow64); + string format = "Software\\Microsoft\\VisualStudio\\{0}"; + string keyName = String.Format(format, vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) @@ -4259,30 +4088,22 @@ return false; if (!Directory.Exists(directory)) return false; - TraceOps.DebugAndTrace(TracePriority.Lower, - debugCallback, traceCallback, String.Format( - "Visual Studio {0} found in directory {1}.", - ForDisplay(vsVersion), ForDisplay(directory)), - traceCategory); - return true; } } /////////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] private static bool ForEachVsVersionRegistry( MockRegistry registry, VsList vsList, VisualStudioRegistryCallback callback, Package package, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) @@ -4325,11 +4146,11 @@ TraceOps.DebugAndTrace(TracePriority.Lower, debugCallback, traceCallback, String.Format( "vsVersion = {0}", ForDisplay(vsVersion)), traceCategory); - if (!HaveVsVersion(rootKey, vsVersion, wow64, whatIf, verbose)) + if (!HaveVsVersion(rootKey, vsVersion, whatIf, verbose)) { TraceOps.DebugAndTrace(TracePriority.Low, debugCallback, traceCallback, "Visual Studio version not found, skipping...", traceCategory); @@ -4339,11 +4160,11 @@ if (callback == null) continue; if (!callback( - rootKey, vsVersion, package, clientData, wow64, + rootKey, vsVersion, package, clientData, throwOnMissing, whatIf, verbose, ref error)) { return false; } } @@ -4353,11 +4174,10 @@ #endregion /////////////////////////////////////////////////////////////////////// #region Configuration File Handling - [MethodImpl(MethodImplOptions.NoInlining)] private static bool AddDbProviderFactory( string fileName, string invariant, string name, string description, @@ -4373,14 +4193,14 @@ XmlDocument document = new XmlDocument(); document.PreserveWhitespace = true; document.Load(fileName); - XmlElement addElement = document.SelectSingleNode( - String.Format(XPathForAddElement, invariant)) as XmlElement; + XmlElement element = document.SelectSingleNode(String.Format( + XPathForAddElement, invariant)) as XmlElement; - if (addElement == null) + if (element == null) { string[] elementNames = { "system.data", "DbProviderFactories" }; @@ -4387,69 +4207,69 @@ XmlElement previousElement = document.DocumentElement; /* configuration */ foreach (string elementName in elementNames) { - addElement = previousElement.SelectSingleNode( - elementName) as XmlElement; - - if (addElement == null) - { - addElement = document.CreateElement( - elementName, String.Empty); - - previousElement.AppendChild(addElement); - } - - previousElement = addElement; - } - - addElement = document.CreateElement( - "add", String.Empty); - - previousElement.AppendChild(addElement); - - dirty = true; - } - - if (!String.Equals(addElement.GetAttribute("name"), - name, StringComparison.Ordinal)) - { - addElement.SetAttribute("name", name); - dirty = true; - } - - if (!String.Equals(addElement.GetAttribute("invariant"), - invariant, StringComparison.Ordinal)) - { - addElement.SetAttribute("invariant", invariant); - dirty = true; - } - - if (!String.Equals(addElement.GetAttribute("description"), - description, StringComparison.Ordinal)) - { - addElement.SetAttribute("description", description); + element = previousElement.SelectSingleNode( + elementName) as XmlElement; + + if (element == null) + { + element = document.CreateElement( + elementName, String.Empty); + + previousElement.AppendChild(element); + } + + previousElement = element; + } + + element = document.CreateElement( + "add", String.Empty); + + previousElement.AppendChild(element); + + dirty = true; + } + + if (!String.Equals(element.GetAttribute("name"), + name, StringComparison.InvariantCulture)) + { + element.SetAttribute("name", name); + dirty = true; + } + + if (!String.Equals(element.GetAttribute("invariant"), + invariant, StringComparison.InvariantCulture)) + { + element.SetAttribute("invariant", invariant); + dirty = true; + } + + if (!String.Equals(element.GetAttribute("description"), + description, StringComparison.InvariantCulture)) + { + element.SetAttribute("description", description); dirty = true; } string fullTypeName = String.Format("{0}, {1}", typeName, assemblyName); - if (!String.Equals(addElement.GetAttribute("type"), - fullTypeName, StringComparison.Ordinal)) + if (!String.Equals(element.GetAttribute("type"), + fullTypeName, StringComparison.InvariantCulture)) { - addElement.SetAttribute("type", fullTypeName); + element.SetAttribute("type", fullTypeName); dirty = true; } if (dirty || whatIf) { if (verbose) TraceOps.DebugAndTrace(TracePriority.Highest, debugCallback, traceCallback, String.Format( - "addElement = {0}", ForDisplay(addElement)), + "element = {0}", ForDisplay(element)), traceCategory); if (!whatIf) document.Save(fileName); @@ -4459,11 +4279,10 @@ return true; } /////////////////////////////////////////////////////////////////////// - [MethodImpl(MethodImplOptions.NoInlining)] private static bool RemoveDbProviderFactory( string fileName, string invariant, bool whatIf, bool verbose, @@ -4475,35 +4294,34 @@ XmlDocument document = new XmlDocument(); document.PreserveWhitespace = true; document.Load(fileName); - XmlElement addElement = document.SelectSingleNode( - String.Format(XPathForAddElement, invariant)) as XmlElement; + XmlElement element = document.SelectSingleNode(String.Format( + XPathForAddElement, invariant)) as XmlElement; - if (addElement != null) + if (element != null) { - addElement.ParentNode.RemoveChild(addElement); + element.ParentNode.RemoveChild(element); dirty = true; } - XmlElement removeElement = document.SelectSingleNode( - String.Format(XPathForRemoveElement, invariant)) as XmlElement; + element = document.SelectSingleNode(String.Format( + XPathForRemoveElement, invariant)) as XmlElement; - if (removeElement != null) + if (element != null) { - removeElement.ParentNode.RemoveChild(removeElement); + element.ParentNode.RemoveChild(element); dirty = true; } if (dirty || whatIf) { if (verbose) TraceOps.DebugAndTrace(TracePriority.Highest, debugCallback, traceCallback, String.Format( - "addElement = {0}, removeElement = {1}", - ForDisplay(addElement), ForDisplay(removeElement)), + "element = {0}", ForDisplay(element)), traceCategory); if (!whatIf) document.Save(fileName); @@ -4521,11 +4339,10 @@ string name, string description, string typeName, AssemblyName assemblyName, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref bool saved, ref string error @@ -4561,25 +4378,19 @@ #region Assembly Folders Handling private static string GetAssemblyFoldersKeyName( string frameworkName, Version frameworkVersion, - string platformName, - bool wow64 + string platformName ) { - // - // NOTE: This registry key appears to always be 32-bit only - // (i.e. probably because it is only used by Visual - // Studio, which is currently always 32-bit only). - // string format = !String.IsNullOrEmpty(platformName) ? - "{0}\\Microsoft\\{1}\\v{2}\\{3}\\AssemblyFoldersEx" : - "{0}\\Microsoft\\{1}\\v{2}\\AssemblyFoldersEx"; + "Software\\Microsoft\\{0}\\v{1}\\{2}\\AssemblyFoldersEx" : + "Software\\Microsoft\\{0}\\v{1}\\AssemblyFoldersEx"; - return String.Format(format, GetRootKeyName(wow64), - frameworkName, frameworkVersion, platformName); + return String.Format(format, frameworkName, frameworkVersion, + platformName); } /////////////////////////////////////////////////////////////////////// private static bool AddToAssemblyFolders( @@ -4587,18 +4398,17 @@ string frameworkName, Version frameworkVersion, string platformName, string subKeyName, string directory, - bool wow64, bool whatIf, bool verbose, ref string error ) { string keyName = GetAssemblyFoldersKeyName( - frameworkName, frameworkVersion, platformName, wow64); + frameworkName, frameworkVersion, platformName); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, true, whatIf, verbose)) { if (key == null) @@ -4636,19 +4446,18 @@ MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, string subKeyName, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) { string keyName = GetAssemblyFoldersKeyName( - frameworkName, frameworkVersion, platformName, wow64); + frameworkName, frameworkVersion, platformName); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, true, whatIf, verbose)) { if (key == null) @@ -4673,11 +4482,10 @@ MockRegistryKey rootKey, string frameworkName, Version frameworkVersion, string platformName, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) @@ -4692,59 +4500,45 @@ if (pair.Y) { return RemoveFromAssemblyFolders( rootKey, frameworkName, frameworkVersion, platformName, - LegacyProjectName, wow64, false, whatIf, verbose, - ref error) && + LegacyProjectName, false, whatIf, verbose, ref error) && AddToAssemblyFolders( rootKey, frameworkName, frameworkVersion, platformName, - ProjectName, pair.X, wow64, whatIf, verbose, ref error); + ProjectName, pair.X, whatIf, verbose, ref error); } else { return RemoveFromAssemblyFolders( rootKey, frameworkName, frameworkVersion, platformName, - ProjectName, wow64, throwOnMissing, whatIf, verbose, - ref error); + ProjectName, throwOnMissing, whatIf, verbose, ref error); } } #endregion /////////////////////////////////////////////////////////////////////// #region Visual Studio Handling - private static string GetVsRootKeyName( - bool wow64 - ) - { - return String.Format("{0}\\Microsoft\\VisualStudio", - GetRootKeyName(wow64)); - } - - /////////////////////////////////////////////////////////////////////// - private static string GetVsKeyName( - Version vsVersion, - bool wow64 + Version vsVersion ) { if (vsVersion == null) return null; - return String.Format( - "{0}\\{1}", GetVsRootKeyName(wow64), vsVersion); + return String.Format("Software\\Microsoft\\VisualStudio\\{0}", + vsVersion); } /////////////////////////////////////////////////////////////////////// #region Visual Studio Data Source Handling private static bool AddVsDataSource( MockRegistryKey rootKey, Version vsVersion, Package package, - bool wow64, bool whatIf, bool verbose, ref string error ) { @@ -4758,11 +4552,11 @@ { error = "invalid VS package"; return false; } - string keyName = GetVsKeyName(vsVersion, wow64); + string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) @@ -4820,11 +4614,10 @@ private static bool RemoveVsDataSource( MockRegistryKey rootKey, Version vsVersion, Package package, - bool wow64, bool whatIf, bool verbose, ref string error ) { @@ -4838,11 +4631,11 @@ { error = "invalid VS package"; return false; } - string keyName = GetVsKeyName(vsVersion, wow64); + string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) @@ -4880,11 +4673,10 @@ private static bool ProcessVsDataSource( MockRegistryKey rootKey, Version vsVersion, Package package, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) @@ -4904,18 +4696,16 @@ } if (pair.Y) { return AddVsDataSource( - rootKey, vsVersion, package, wow64, whatIf, verbose, - ref error); + rootKey, vsVersion, package, whatIf, verbose, ref error); } else { return RemoveVsDataSource( - rootKey, vsVersion, package, wow64, whatIf, verbose, - ref error); + rootKey, vsVersion, package, whatIf, verbose, ref error); } } #endregion /////////////////////////////////////////////////////////////////////// @@ -4924,11 +4714,10 @@ private static bool AddVsDataProvider( MockRegistryKey rootKey, Version vsVersion, Package package, string fileName, - bool wow64, bool whatIf, bool verbose, ref string error ) { @@ -4942,11 +4731,11 @@ { error = "invalid VS package"; return false; } - string keyName = GetVsKeyName(vsVersion, wow64); + string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) @@ -5036,11 +4825,10 @@ private static bool RemoveVsDataProvider( MockRegistryKey rootKey, Version vsVersion, Package package, - bool wow64, bool whatIf, bool verbose, ref string error ) { @@ -5048,11 +4836,11 @@ { error = "invalid VS version"; return false; } - string keyName = GetVsKeyName(vsVersion, wow64); + string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) @@ -5090,11 +4878,10 @@ private static bool ProcessVsDataProvider( MockRegistryKey rootKey, Version vsVersion, Package package, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) @@ -5108,18 +4895,18 @@ } if (pair.Y) { return AddVsDataProvider( - rootKey, vsVersion, package, pair.X, wow64, whatIf, - verbose, ref error); + rootKey, vsVersion, package, pair.X, + whatIf, verbose, ref error); } else { return RemoveVsDataProvider( - rootKey, vsVersion, package, wow64, whatIf, verbose, - ref error); + rootKey, vsVersion, package, whatIf, + verbose, ref error); } } #endregion /////////////////////////////////////////////////////////////////////// @@ -5155,11 +4942,10 @@ private static bool AddVsPackage( MockRegistryKey rootKey, Version vsVersion, Package package, string fileName, - bool wow64, bool whatIf, bool verbose, ref string error ) { @@ -5173,11 +4959,11 @@ { error = "invalid VS package"; return false; } - string keyName = GetVsKeyName(vsVersion, wow64); + string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) @@ -5199,29 +4985,10 @@ key); return false; } - // - // NOTE: *WARNING* Changing any of these values will likely - // require a new "package load key" (PLK) to be - // generated in order to properly support loading the - // package into Visual Studio 2008 and earlier without - // the matching Visual Studio SDK being installed. - // Please refer to the "SQLite.Designer\plk.txt" file - // for the existing official values and update them if - // necessary. Also, the newly generated package load - // key itself, which is a 128 character alphanumeric - // string, must be placed in the resource string named - // "400" in the "SQLite.Designer\VSPackage.resx" file - // and then the designer assembly itself must be - // recompiled. As of this writing (in February 2012), - // the following URL is the proper place to generate - // package load keys: - // - // http://msdn.microsoft.com/en-us/vstudio/cc655795 - // using (MockRegistryKey packageKey = RegistryHelper.CreateSubKey(subKey, package.PackageId.ToString(VsIdFormat), whatIf, verbose)) { @@ -5345,11 +5112,10 @@ private static bool RemoveVsPackage( MockRegistryKey rootKey, Version vsVersion, Package package, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) @@ -5364,11 +5130,11 @@ { error = "invalid VS package"; return false; } - string keyName = GetVsKeyName(vsVersion, wow64); + string keyName = GetVsKeyName(vsVersion); using (MockRegistryKey key = RegistryHelper.OpenSubKey( rootKey, keyName, false, whatIf, verbose)) { if (key == null) @@ -5440,11 +5206,10 @@ private static bool ProcessVsPackage( MockRegistryKey rootKey, Version vsVersion, Package package, object clientData, - bool wow64, bool throwOnMissing, bool whatIf, bool verbose, ref string error ) @@ -5458,59 +5223,35 @@ } if (pair.Y) { return AddVsPackage( - rootKey, vsVersion, package, pair.X, wow64, whatIf, - verbose, ref error); + rootKey, vsVersion, package, pair.X, whatIf, verbose, + ref error); } else { return RemoveVsPackage( - rootKey, vsVersion, package, wow64, throwOnMissing, - whatIf, verbose, ref error); + rootKey, vsVersion, package, throwOnMissing, whatIf, + verbose, ref error); } } #endregion #endregion /////////////////////////////////////////////////////////////////////// #region Application Entry Point - [MethodImpl(MethodImplOptions.NoInlining)] private static int Main( string[] args ) { try { Configuration configuration = null; string error = null; - /////////////////////////////////////////////////////////////// - - #region Debugger Hook - if (Environment.GetEnvironmentVariable("Break") != null) - { - Console.WriteLine( - "Attach a debugger to process {0} and " + - "press any key to continue.", - Process.GetCurrentProcess().Id); - - try - { - Console.ReadKey(true); /* throw */ - } - catch (InvalidOperationException) // Console.ReadKey - { - // do nothing. - } - - Debugger.Break(); - } - #endregion - /////////////////////////////////////////////////////////////// #region Command Line Processing if (!Configuration.FromArgs( args, true, ref configuration, ref error) || @@ -5641,13 +5382,11 @@ if (configuration.HasFlags( InstallFlags.AssemblyFolders, true)) { if (!ForEachFrameworkRegistry(registry, frameworkList, ProcessAssemblyFolders, - directoryData, - NetFxIs32BitOnly || configuration.Wow64, - configuration.ThrowOnMissing, + directoryData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, @@ -5672,13 +5411,12 @@ bool saved = false; if (!ForEachFrameworkConfig(registry, frameworkList, ProcessDbProviderFactory, InvariantName, ProviderName, Description, - FactoryTypeName, assemblyName, directoryData, - NetFxIs32BitOnly || configuration.Wow64, - configuration.ThrowOnMissing, + FactoryTypeName, assemblyName, + directoryData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref saved, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, @@ -5700,13 +5438,11 @@ if (configuration.HasFlags( InstallFlags.VsPackage, true)) { if (!ForEachVsVersionRegistry(registry, vsList, ProcessVsPackage, package, - fileNameData, - VsIs32BitOnly || configuration.Wow64, - configuration.ThrowOnMissing, + fileNameData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, @@ -5728,13 +5464,11 @@ if (configuration.HasFlags( InstallFlags.VsDataSource, true)) { if (!ForEachVsVersionRegistry(registry, vsList, ProcessVsDataSource, package, - fileNameData, - VsIs32BitOnly || configuration.Wow64, - configuration.ThrowOnMissing, + fileNameData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, @@ -5756,13 +5490,11 @@ if (configuration.HasFlags( InstallFlags.VsDataProvider, true)) { if (!ForEachVsVersionRegistry(registry, vsList, ProcessVsDataProvider, package, - fileNameData, - VsIs32BitOnly || configuration.Wow64, - configuration.ThrowOnMissing, + fileNameData, configuration.ThrowOnMissing, configuration.WhatIf, configuration.Verbose, ref error)) { TraceOps.ShowMessage(TracePriority.Highest, debugCallback, traceCallback, thisAssembly, Index: tools/install/Properties/AssemblyInfo.cs ================================================================== --- tools/install/Properties/AssemblyInfo.cs +++ tools/install/Properties/AssemblyInfo.cs @@ -26,7 +26,7 @@ // Major Version // Minor Version // Build Number // Revision // -[assembly: AssemblyVersion("1.0.81.0")] -[assembly: AssemblyFileVersion("1.0.81.0")] +[assembly: AssemblyVersion("1.0.78.0")] +[assembly: AssemblyFileVersion("1.0.78.0")] Index: www/build.wiki ================================================================== --- www/build.wiki +++ www/build.wiki @@ -125,13 +125,12 @@
    • <root>\Doc\Extra\dbfactorysupport.html
    • <root>\Doc\Extra\welcome.html
    • <root>\Membership\Properties\AssemblyInfo.cs
    • <root>\SQLite.Designer\AssemblyInfo.cs
    • <root>\SQLite.Designer\source.extension.vsixmanifest
    • -
    • <root>\SQLite.Interop\props\SQLite.Interop.2005.vsprops
    • -
    • <root>\SQLite.Interop\props\SQLite.Interop.2008.vsprops
    • -
    • <root>\SQLite.Interop\props\SQLite.Interop.2010.props
    • +
    • <root>\SQLite.Interop\props\SQLite.Interop.vsprops
    • +
    • <root>\SQLite.Interop\props\SQLite.Interop.props
    • <root>\SQLite.Interop\src\win\interop.h
    • <root>\System.Data.SQLite\AssemblyInfo.cs
    • <root>\System.Data.SQLite\SQLite3.cs
    • <root>\System.Data.SQLite\UnsafeNativeMethods.cs
    • <root>\System.Data.SQLite.Linq\AssemblyInfo.cs
    • Index: www/checkin.wiki ================================================================== --- www/checkin.wiki +++ www/checkin.wiki @@ -1,16 +1,16 @@ Check-in Checklist Before every check-in: - 1. fossil diff → No stray changes. + 1. fossil diff → no stray changes - 2. fossil extra → No unmanaged files need to be added. + 2. fossil extra → no unmanaged files need to be added. 3. The check-in will go onto the desired branch. - 4. The "autosync" setting is enabled. → + 4. "Autosync" is enabled →
      1. The check-in will not cause a unintentional fork.
      2. The local system clock is set correctly.
      @@ -17,9 +17,5 @@ Before every check-in to trunk: 5. No compiler warnings on the development machine. 6. Changes will not cause problems on a future bisect. - - 7. Build binaries as outlined on the [./build.wiki | build procedures] page. - - 8. Run unit tests as outlined on the [./test.wiki | test procedures] page. Index: www/downloads.wiki ================================================================== --- www/downloads.wiki +++ www/downloads.wiki @@ -9,21 +9,21 @@
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
      - sqlite-netFx-source-1.0.80.0.zip + + sqlite-netFx-source-1.0.77.0.zip
    - (2.68 MiB) + (2.57 MiB)
    This ZIP archive contains all current source code for System.Data.SQLite - 1.0.80.0 (3.7.11) combined into a single archive file. + 1.0.77.0 (3.7.9) combined into a single archive file.
    - (sha1: 96e37d1d9146f9cd6721ef273eb3973d1612c0ad) + (sha1: 84e9b80b767118caf06206c3e83cb53eddb89a08)
    @@ -31,41 +31,41 @@
      - sqlite-netFx35-setup-bundle-x86-2008-1.0.80.0.exe + + sqlite-netFx35-setup-bundle-x86-2008-1.0.77.0.exe
    - (6.04 MiB) + (5.88 MiB)
    This setup package features the mixed-mode assembly and will install all the necessary runtime components and dependencies for the x86 version of - the System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2008 + the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 is included. The .NET Framework 3.5 SP1 is required.
    - (sha1: a4b9b35779ae85ce02f0e0a622f3039163335858) + (sha1: d772f21988d166e25b21ea73d645de249f083883)
      - sqlite-netFx35-setup-x86-2008-1.0.80.0.exe + + sqlite-netFx35-setup-x86-2008-1.0.77.0.exe
    - (6.03 MiB) + (5.88 MiB)
    This setup package will install all the necessary runtime components and - dependencies for the x86 version of the System.Data.SQLite 1.0.80.0 - (3.7.11) package. The Visual C++ 2008 SP1 runtime for x86 is included. + dependencies for the x86 version of the System.Data.SQLite 1.0.77.0 + (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 is included. The .NET Framework 3.5 SP1 is required.
    - (sha1: d8ddde29f3fc0ded715d632501809158c174fd4a) + (sha1: 6257afc0cc2fefb7c4f72ffe52fe12941ee1c053)
    @@ -73,41 +73,41 @@
      - sqlite-netFx35-setup-bundle-x64-2008-1.0.80.0.exe + + sqlite-netFx35-setup-bundle-x64-2008-1.0.77.0.exe
    - (6.77 MiB) + (6.62 MiB)
    This setup package features the mixed-mode assembly and will install all the necessary runtime components and dependencies for the x64 version of - the System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2008 + the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 is included. The .NET Framework 3.5 SP1 is required.
    - (sha1: 65d6b88e6180f0956ed189de2e8595fb70d90970) + (sha1: 3e503a9292b361e24d46ee814bf3ff4c1d0bbaa2)
      - sqlite-netFx35-setup-x64-2008-1.0.80.0.exe + + sqlite-netFx35-setup-x64-2008-1.0.77.0.exe
    - (6.77 MiB) + (6.61 MiB)
    This setup package will install all the necessary runtime components and - dependencies for the x64 version of the System.Data.SQLite 1.0.80.0 - (3.7.11) package. The Visual C++ 2008 SP1 runtime for x64 is included. + dependencies for the x64 version of the System.Data.SQLite 1.0.77.0 + (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 is included. The .NET Framework 3.5 SP1 is required.
    - (sha1: 93da8e2d4e556c232587251f826d8e87da4969c9) + (sha1: 344e03e91c5f95e09e4dbaa8336dfbe75ece875b)
    @@ -115,41 +115,41 @@
      - sqlite-netFx40-setup-bundle-x86-2010-1.0.80.0.exe + + sqlite-netFx40-setup-bundle-x86-2010-1.0.77.0.exe
    - (10.36 MiB) + (10.25 MiB)
    This setup package features the mixed-mode assembly and will install all the necessary runtime components and dependencies for the x86 version of - the System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2010 + the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 is included. The .NET Framework 4.0 is required.
    - (sha1: 0d7a51989eb3f23bbf3d695c9af264666031e7c3) + (sha1: c1f51270764c2d694a6e19ef0200243a4212c021)
      - sqlite-netFx40-setup-x86-2010-1.0.80.0.exe + + sqlite-netFx40-setup-x86-2010-1.0.77.0.exe
    - (10.36 MiB) + (10.24 MiB)
    This setup package will install all the necessary runtime components and - dependencies for the x86 version of the System.Data.SQLite 1.0.80.0 - (3.7.11) package. The Visual C++ 2010 SP1 runtime for x86 is included. + dependencies for the x86 version of the System.Data.SQLite 1.0.77.0 + (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 is included. The .NET Framework 4.0 is required.
    - (sha1: ee2a4dde8f470eee99d1a616c5c2eab0dd2e245e) + (sha1: c80d75dab1c3692be27f47c5db7d4b55af2891c3)
    @@ -157,41 +157,41 @@
      - sqlite-netFx40-setup-bundle-x64-2010-1.0.80.0.exe + + sqlite-netFx40-setup-bundle-x64-2010-1.0.77.0.exe
    - (11.62 MiB) + (12.04 MiB)
    This setup package features the mixed-mode assembly and will install all the necessary runtime components and dependencies for the x64 version of - the System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2010 + the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 is included. The .NET Framework 4.0 is required.
    - (sha1: e2a1b48e4e743d0224f2a6607be6b067426ab34b) + (sha1: 34a56eaee1d876278f42a3626b12ac6eb5713b3d)
      - sqlite-netFx40-setup-x64-2010-1.0.80.0.exe + + sqlite-netFx40-setup-x64-2010-1.0.77.0.exe
    - (11.61 MiB) + (12.03 MiB)
    This setup package will install all the necessary runtime components and - dependencies for the x64 version of the System.Data.SQLite 1.0.80.0 - (3.7.11) package. The Visual C++ 2010 SP1 runtime for x64 is included. + dependencies for the x64 version of the System.Data.SQLite 1.0.77.0 + (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 is included. The .NET Framework 4.0 is required.
    - (sha1: 6e9fcd43446d88238875b8a1d83ec28e831fb0be) + (sha1: aabcb26ed62540968d27a441995053b5260e9b74)
    @@ -199,40 +199,40 @@
      - sqlite-netFx35-binary-bundle-Win32-2008-1.0.80.0.zip + + sqlite-netFx35-binary-bundle-Win32-2008-1.0.77.0.zip
    - (1.61 MiB) + (1.97 MiB)
    This binary package features the mixed-mode assembly and contains all the - binaries for the x86 version of the System.Data.SQLite 1.0.80.0 (3.7.11) + binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 and the .NET Framework 3.5 SP1 are required.
    - (sha1: 63240eacb4af8c507a6957e177de1a375db32e18) + (sha1: e7103c196e725196c0b591386ec34c7a80c9eb83)
      - sqlite-netFx35-binary-Win32-2008-1.0.80.0.zip + + sqlite-netFx35-binary-Win32-2008-1.0.77.0.zip
    - (1.62 MiB) + (1.97 MiB)
    This binary package contains all the binaries for the x86 version of the - System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2008 SP1 + System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 and the .NET Framework 3.5 SP1 are required.
    - (sha1: 3159f8d2df5473ea1c42c603ec7a43f9d3aaf939) + (sha1: 0c36eaf45c99b4e0a56f00711bce04b30b979578)
    @@ -240,40 +240,40 @@
      - sqlite-netFx35-binary-bundle-x64-2008-1.0.80.0.zip + + sqlite-netFx35-binary-bundle-x64-2008-1.0.77.0.zip
    - (1.68 MiB) + (2.04 MiB)
    This binary package features the mixed-mode assembly and contains all the - binaries for the x64 version of the System.Data.SQLite 1.0.80.0 (3.7.11) + binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 and the .NET Framework 3.5 SP1 are required.
    - (sha1: 188f4fd49c9199474e7dec951d1702869f6b7bed) + (sha1: ac39f8a600c846ce957b17380636b5b6ce2155c4)
      - sqlite-netFx35-binary-x64-2008-1.0.80.0.zip + + sqlite-netFx35-binary-x64-2008-1.0.77.0.zip
    - (1.69 MiB) + (2.03 MiB)
    This binary package contains all the binaries for the x64 version of the - System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2008 SP1 + System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 and the .NET Framework 3.5 SP1 are required.
    - (sha1: 2d841e8f28cbbb95942afffde159b9beb8ecb9d0) + (sha1: b2595aaf38de226241567cbfa9d6402b92de6658)
    @@ -281,40 +281,40 @@
      - sqlite-netFx40-binary-bundle-Win32-2010-1.0.80.0.zip + + sqlite-netFx40-binary-bundle-Win32-2010-1.0.77.0.zip
    - (1.69 MiB) + (2.02 MiB)
    This binary package features the mixed-mode assembly and contains all the - binaries for the x86 version of the System.Data.SQLite 1.0.80.0 (3.7.11) + binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 and the .NET Framework 4.0 are required.
    - (sha1: f29643dd4be2876487c054ee5f2dca87e46f80a4) + (sha1: c74d1bc4f15c98a717706e6c3dcafb74e161d373)
      - sqlite-netFx40-binary-Win32-2010-1.0.80.0.zip + + sqlite-netFx40-binary-Win32-2010-1.0.77.0.zip
    - (1.66 MiB) + (2.01 MiB)
    This binary package contains all the binaries for the x86 version of the - System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2010 SP1 + System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 and the .NET Framework 4.0 are required.
    - (sha1: 0c88572b2794ca75d08c8a6ab66fe1edce9ae825) + (sha1: 5467fbd64d2e9a108c479e8449496270f082f9bb)
    @@ -322,40 +322,40 @@
      - sqlite-netFx40-binary-bundle-x64-2010-1.0.80.0.zip + + sqlite-netFx40-binary-bundle-x64-2010-1.0.77.0.zip
    - (1.68 MiB) + (1.46 MiB)
    This binary package features the mixed-mode assembly and contains all the - binaries for the x64 version of the System.Data.SQLite 1.0.80.0 (3.7.11) + binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 and the .NET Framework 4.0 are required.
    - (sha1: 32b30e7430d92ce7192ce83451e8a9862f1e5d97) + (sha1: 16cd8e7e7de4c0786aafbae5ee3a7587ac431cc7)
      - sqlite-netFx40-binary-x64-2010-1.0.80.0.zip + + sqlite-netFx40-binary-x64-2010-1.0.77.0.zip
    - (1.67 MiB) + (1.45 MiB)
    This binary package contains all the binaries for the x64 version of the - System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2010 SP1 + System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 and the .NET Framework 4.0 are required.
    - (sha1: 81d53e5b515b8906b875d994c0d8a60224b842fc) + (sha1: 01746a35858f6df8430335042b0ccb3edb38b7a9)
    @@ -363,41 +363,41 @@
      - sqlite-netFx35-static-binary-bundle-Win32-2008-1.0.80.0.zip + + sqlite-netFx35-static-binary-bundle-Win32-2008-1.0.77.0.zip
    - (1.88 MiB) + (2.19 MiB)
    This binary package features the mixed-mode assembly and contains all the - binaries for the x86 version of the System.Data.SQLite 1.0.80.0 (3.7.11) + binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 is statically linked. The .NET Framework 3.5 SP1 is required.
    - (sha1: 62e17ad898954b884c78f331f03376dfa7cb15c2) + (sha1: e24120452d888aa19fde8409bba58f00b888ea19)
      - sqlite-netFx35-static-binary-Win32-2008-1.0.80.0.zip + + sqlite-netFx35-static-binary-Win32-2008-1.0.77.0.zip
    - (1.83 MiB) + (2.18 MiB)
    This binary package contains all the binaries for the x86 version of the - System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2008 SP1 + System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x86 is statically linked. The .NET Framework 3.5 SP1 is required.
    - (sha1: aa5d46057977a99e1eb275526bf0b5baea087026) + (sha1: 371ae4d78b3fd28d46e2ee03c0cdf4fc0c305be7)
    @@ -405,41 +405,41 @@
      - sqlite-netFx35-static-binary-bundle-x64-2008-1.0.80.0.zip + + sqlite-netFx35-static-binary-bundle-x64-2008-1.0.77.0.zip
    - (1.89 MiB) + (2.22 MiB)
    This binary package features the mixed-mode assembly and contains all the - binaries for the x64 version of the System.Data.SQLite 1.0.80.0 (3.7.11) + binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 is statically linked. The .NET Framework 3.5 SP1 is required.
    - (sha1: 4a3863c15848fae10c4521c6c30c630f1a5e07d4) + (sha1: fa689fa65fe2477b9fb9aeeddc5b73849cdb5147)
      - sqlite-netFx35-static-binary-x64-2008-1.0.80.0.zip + + sqlite-netFx35-static-binary-x64-2008-1.0.77.0.zip
    - (1.84 MiB) + (2.21 MiB)
    This binary package contains all the binaries for the x64 version of the - System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2008 SP1 + System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2008 SP1 runtime for x64 is statically linked. The .NET Framework 3.5 SP1 is required.
    - (sha1: 098caf7d4adab54d8c20cd0bfb5553b353b236c4) + (sha1: 497b8cd02cd92fc597e852db2bc36ed77dca0659)
    @@ -447,40 +447,40 @@
      - sqlite-netFx40-static-binary-bundle-Win32-2010-1.0.80.0.zip + + sqlite-netFx40-static-binary-bundle-Win32-2010-1.0.77.0.zip
    - (1.89 MiB) + (2.24 MiB)
    This binary package features the mixed-mode assembly and contains all the - binaries for the x86 version of the System.Data.SQLite 1.0.80.0 (3.7.11) + binaries for the x86 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 is statically linked. The .NET Framework 4.0 is required.
    - (sha1: ce97513d2fa7ba9b7dec0f3c45c58b0ba3e749c3) + (sha1: 984cbc9b831b67ea4c7417ee6c041bc5e6bb2b45)
      - sqlite-netFx40-static-binary-Win32-2010-1.0.80.0.zip + + sqlite-netFx40-static-binary-Win32-2010-1.0.77.0.zip
    - (1.88 MiB) + (2.23 MiB)
    This binary package contains all the binaries for the x86 version of the - System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2010 SP1 + System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x86 is statically linked. The .NET Framework 4.0 is required.
    - (sha1: 50acae4e4f60ecc4e9a992191c2e8df47d6145e0) + (sha1: 53489a918aa53823c2b82608548486d1a1c030f6)
    @@ -488,40 +488,40 @@
      - sqlite-netFx40-static-binary-bundle-x64-2010-1.0.80.0.zip + + sqlite-netFx40-static-binary-bundle-x64-2010-1.0.77.0.zip
    - (1.87 MiB) + (2.24 MiB)
    This binary package features the mixed-mode assembly and contains all the - binaries for the x64 version of the System.Data.SQLite 1.0.80.0 (3.7.11) + binaries for the x64 version of the System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 is statically linked. The .NET Framework 4.0 is required.
    - (sha1: 9b412b19857bf123683e15dac3fa89bdabf59bc5) + (sha1: 4fe5b9bf86ec6b602af981a477be1e7942199f1c)
      - sqlite-netFx40-static-binary-x64-2010-1.0.80.0.zip + + sqlite-netFx40-static-binary-x64-2010-1.0.77.0.zip
    - (1.86 MiB) + (2.23 MiB)
    This binary package contains all the binaries for the x64 version of the - System.Data.SQLite 1.0.80.0 (3.7.11) package. The Visual C++ 2010 SP1 + System.Data.SQLite 1.0.77.0 (3.7.9) package. The Visual C++ 2010 SP1 runtime for x64 is statically linked. The .NET Framework 4.0 is required.
    - (sha1: 4e3bcc6a28813fa57bfd6b63a85406a3beb0de79) + (sha1: 2efbfc06e126eb49deda6799124921111e427d2a)
    @@ -529,22 +529,22 @@
      - sqlite-netFx35-binary-PocketPC-2008-1.0.80.0.zip + + sqlite-netFx35-binary-PocketPC-2008-1.0.77.0.zip
    - (0.82 MiB) + (0.80 MiB)
    This binary package contains all the binaries for the PocketPC version of - the System.Data.SQLite 1.0.80.0 (3.7.11) package. The .NET Compact + the System.Data.SQLite 1.0.77.0 (3.7.9) package. The .NET Compact Framework 3.5 is required.
    - (sha1: 14f204b9a842623be3a514372b810d3eb64edae0) + (sha1: c7227c3b968028f4b1260b5d1bd244c950f7fbac)
    @@ -552,20 +552,20 @@
      + SQLite-1.0.66.0-setup.exe
    (3.2 MiB)
    Legacy versions, as well as the original support forums, may still be - found at [http://sqlite.phxsoftware.com/], though there have been no - updates to this version since April of 2010. + found at [http://sqlite.phxsoftware.com/], though there have been no updates + to this version since April of 2010.

    Build Product Names

    @@ -600,35 +600,31 @@ statically linked to the Visual C++ runtime. Template (9) is used for unofficial pre-release "snapshots" of source code.

    - The framework in templates (3), (4), (5), (6), (7), and (8) will be - one of netFx35, netFx40. -

    - -

    - The cpu in templates (3) and (4) will be one of x86, x64, arm, ia64. -

    - -

    - The platform in templates (5), (6), (7), and (8) will be one of Win32, - x64, PocketPC. -

    - -

    - The year in templates (3), (4), (5), (6), (7), and (8) will be one of - 2008, 2010. -

    - -

    - The version in templates (1), (2), (3), (4), (5), (6), (7), and (8) is - the dot-delimited version number of the primary System.Data.SQLite assembly. -

    - -

    - The date in template (9) is of the form: YYYYMMDDHHMM + The framework in templates (3), (4), (5), (6), (7), and (8) will be one of netFx35, netFx40. +

    + +

    + The cpu in templates (3) and (4) will be one of x86, x64, arm, ia64. +

    + +

    + The platform in templates (5), (6), (7), and (8) will be one of Win32, x64, PocketPC. +

    + +

    + The year in templates (3), (4), (5), (6), (7), and (8) will be one of 2008, 2010. +

    + +

    + The version in templates (1), (2), (3), (4), (5), (6), (7), and (8) is the dot-delimited version number of the primary System.Data.SQLite assembly. +

    + +

    + The date in template (9) is of the form: YYYYMMDDHHMM

    Canonical Source Code

    @@ -638,8 +634,8 @@ or ZIP archives of historical check-ins.

    The complete source tree for any [/timeline?n=20&y=ci | check-in] may always - be downloaded using the "Tarball" or "ZIP archive" links - available from the check-in detail page. + be downloaded using the "ZIP archive" link available from the + check-in detail page.

    Index: www/faq.wiki ================================================================== --- www/faq.wiki +++ www/faq.wiki @@ -94,18 +94,10 @@
  • When the solution is loaded in Visual Studio, why do no files show up for several of the projects in the Solution Explorer window?
  • -
    -
  • - When the System.Data.SQLite project is compiled and run from - inside Visual Studio, why do I get a DllNotFoundException or a - BadImageFormatException (for "sqlite3.dll" or - "SQLite.Interop.dll") when trying to run or debug the application? - -

  • @@ -450,35 +442,5 @@ design-time, the C# source code files do not show up in the Solution Explorer window. This limitation is largely cosmetic and does not impact the correctness of the build process itself, whether in Visual Studio or when using MSBuild on the command line.

    - -
    - -

    - (20) When the System.Data.SQLite project is compiled and run from inside - Visual Studio, why do I get a DllNotFoundException or a BadImageFormatException - (for "sqlite3.dll" or "SQLite.Interop.dll") when trying to - run or debug the application? -

    - -

    - When compiling and running a solution from within Visual Studio that uses the - System.Data.SQLite project (including the test project), it is very important - to select the correct build configuration and platform. First, managed - applications to be debugged inside Visual Studio cannot use the mixed-mode - assembly (i.e. because it is always compiled to the platform-specific build - output directory). This is necessary to properly support building binaries - for multiple platforms using the same source project files. Therefore, only - the "DebugNativeOnly" or "ReleaseNativeOnly" build - configurations should be selected when running a managed application from - inside Visual Studio that relies upon the System.Data.SQLite assembly. These - build configurations contain a custom post-build step that copies the required - native assembly to the managed output directory (i.e. to enable running the - managed binaries in-place). However, this post-build step will only be - performed if the selected platform matches that of the operating system (e.g. - "Win32" for 32-bit Windows and "x64" for 64-bit Windows). - Therefore, it is good practice to double-check the selected build platform - against the operating system prior to attempting to run a managed project in - the solution. -

    Index: www/features.wiki ================================================================== --- www/features.wiki +++ www/features.wiki @@ -37,12 +37,13 @@ 2005/2008/2010. You can add a SQLite database to the Servers list, design queries with the Query Designer, drag-and-drop tables onto a Typed DataSet, etc.
    - Due to Visual Studio licensing restrictions, the Express Editions can no - longer be supported. + Currently not included. We are still updating the design-time support + installer. Due to Visual Studio licensing restrictions, the Express + Editions can no longer be supported.
  • Full SQLite schema editing inside Visual Studio. You can create/edit tables, Index: www/news.wiki ================================================================== --- www/news.wiki +++ www/news.wiki @@ -1,70 +1,15 @@ News Version History

    - 1.0.81.0 - June XX, 2012 (release scheduled) -

    -
      -
    • Updated to [http://www.sqlite.org/releaselog/3_7_12.html|SQLite 3.7.12].
    • -
    • Support compiling the interop assembly without support for the custom extension functions and the CryptoAPI based codec.
    • -
    • Add DefineConstants property to the SQLiteConnection class to return the list of define constants used when compiling the core managed assembly.
    • -
    • Add release archive verification tool to the release automation.
    • -
    • Fix subtle race condition between threads fetching connection handles from the connection pool any garbage collection (GC) threads that may be running. Fix for [996d13cd87].
    • -
    • Add missing call to SetTimeout in the SQLite3_UTF16.Open method.
    • -
    • Add checks to prevent the SQLiteConnectionPool.Remove method from returning any connection handles that are closed or invalid.
    • -
    • Modify static SQLiteBase helper methods to prevent them from passing IntPtr.Zero to the SQLite native library.
    • -
    • Remove static locks from the static helper methods in the SQLiteBase class, replacing them with a lock on the connection handle instance being operated upon.
    • -
    • Revise CriticalHandle derived classes to make them more thread-safe.
    • -
    • Add connection pool related diagnostic messages when compiled with the DEBUG define constant.
    • -
    • Add PoolCount property to the SQLiteConnection class to return the number of pool entries for the file name associated with the connection.
    • -
    • Rename internal SQLiteLastError methods to GetLastError.
    • -
    • Add assembly file test constraints to all tests that execute the "test.exe" or "testlinq.exe" files.
    • -
    -

    - 1.0.80.0 - April 1, 2012 -

    -
      -
    • Updated to [http://www.sqlite.org/releaselog/3_7_11.html|SQLite 3.7.11].
    • -
    • In the SQLiteFunction class, when calling user-provided methods from a delegate called by native code, avoid throwing exceptions, optionally tracing the caught exceptions. Fix for [8a426d12eb].
    • -
    • Add Visual Studio 2005 support to all the applicable solution/project files, their associated supporting files, and the test suite.
    • -
    • Add Visual Studio 2005 support to the redesigned designer support installer.
    • -
    • Add experimental support for "pre-loading" the native SQLite library based on the processor architecture of the current process. This feature is now enabled by default at compile-time.
    • -
    • Add support for the native [http://www.sqlite.org/backup.html|SQLite Online Backup API]. Fix for [c71846ed57].
    • -
    • Acquire and hold a static data lock while checking if the native SQLite library has been initialized to prevent a subtle race condition that can result in superfluous error messages. Fix for [72905c9a77].
    • -
    • Support tracing of all parameter binding activity and use the connection flags to control what is traced.
    • -
    • When converting a DateTime instance of an "Unspecified" kind to a string, use the same kind as the connection, if available.
    • -
    • Add overload of the SQLiteDataReader.GetValues method that returns a NameValueCollection.
    • -
    • Add static ToUnixEpoch method to the SQLiteConvert class to convert a DateTime value to the number of whole seconds since the Unix epoch.
    • -
    • In the implicit conversion operators (to IntPtr) for both the SQLiteConnectionHandle and SQLiteStatementHandle classes, return IntPtr.Zero if the instance being converted is null.
    • -
    • Write warning message to the active trace listeners (for the Debug build configuration only) if a column type or type name cannot be mapped properly. See [4bbf851fa5].
    • -
    • When tracing SQL statements to be prepared, bypass the internal length limit of the sqlite3_log function by using the SQLiteLog class directly instead. Also, detect null and/or empty strings and emit a special message in that case.
    • -
    • For the setup, the Visual Studio task should only be initially checked if the GAC task is available and vice-versa.
    • -
    • Improve compatibility with custom command processors by using __ECHO instead of _ECHO in batch tools.
    • -
    • Add OpenAndReturn method to the SQLiteConnection class to open a connection and return it.
    • -
    • Add missing CheckDisposed calls to the SQLiteConnection class.
    • -
    • Add missing throw statement to the SQLiteConnection class.
    • -
    • Make sure the interop project uses /fp:precise for Windows CE.
    • -
    • Regenerate package load key to support loading the designer package into Visual Studio 2008 without having the matching SDK installed.
    • -
    • Modify transaction object disposal so that it can never cause an exception to be thrown.
    • -
    -

    - 1.0.79.0 - January 28, 2012 -

    -
      -
    • Use the WoW64 registry keys when installing the VS designer components on 64-bit Windows. Fix for [d8491abd0b].
    • -
    • Correct resource name used by the LINQ assembly to locate several key string resources. Fix for [fbebb30da9].
    • -
    -

    - 1.0.78.0 - January 27, 2012 + 1.0.78.0 - January XX, 2012 (release pending)

    • Updated to [http://www.sqlite.org/releaselog/3_7_10.html|SQLite 3.7.10]
    • Redesign the VS designer support installer and integrate it into the setup packages.
    • -
    • When emitting SQL for foreign keys in the VS designer, be sure to take all returned schema rows into account. Remainder of fix for [b226147b37].
    • -
    • Add Flags connection string property to control extra behavioral flags for the connection.
    • Refactor all IDisposable implementations to conform to best practices, potentially eliminating leaks in certain circumstances.
    • Even more enhancements to the build and test automation.
    • Support parameter binding to more primitive types, including unsigned integer types.
    • Recognize the TIMESTAMP column data type as the DateTime type. Fix for [bb4b04d457].
    • Prevent logging superfluous messages having to do with library initialization checking. Fix for [3fc172d1be].
    • Index: www/release.wiki ================================================================== --- www/release.wiki +++ www/release.wiki @@ -26,36 +26,10 @@ Enter the following command to build all the x86 and x64 binaries:  build_all.bat
      - -

      Test x86 & x64 Binaries

      - -
        -
      1. - The binaries for all supported architectures and platforms must be tested - using procedures very similar to those documented in the normal - [./test.wiki | test procedures]. -
      2. - -
      3. Open a normal command prompt window with "cmd.exe".
      4. - -
      5. Change the current directory to "<root>\Setup".
      6. - -
      7. - Enter the following command to test all the x86 or x64 binaries, depending - on the processor architecture of the current machine:  - test_all.bat
        -
      8. - -
      9. - Locate a machine with a processor architecture different from the one tested - in the previous step and then repeat all the previous steps. -
      10. -
      -

      Build Windows CE Binaries

      1. Open a normal command prompt window with "cmd.exe".
      2. @@ -66,60 +40,10 @@ Enter the following command to build all the binaries available for Windows CE: build_ce.bat
      - -

      Test Windows CE Binaries

      - -
        -
      1. - Launch Visual Studio 2008, "Professional" edition or - "better". As of this writing, in January 2012, Visual Studio - 2010 and later will not work as they do not include the necessary - built-in support for Windows CE and the .NET Compact Framework. -
      2. - -
      3. - Open the "SQLite.NET.2008.sln" solution file in the - "<root>" directory. -
      4. - -
      5. - Change the active solution configuration to "Debug". -
      6. - -
      7. - Change the active solution platform to "Pocket PC 2003 - (ARMV4)". -
      8. - -
      9. - Right-click the "testce" project in the Solution Explorer - window and select "Set as StartUp Project". -
      10. - -
      11. - Select "Start Debugging" from the "Debug" - menu. -
      12. - -
      13. - If any rebuild prompts appear (e.g. "SQLite.Interop.CE.2008", - "Would you like to build it?"), select "Yes". -
      14. - -
      15. - When prompted for the device type to deploy the application to, select the - "Pocket PC 2003 SE Emulator" device. -
      16. - -
      17. - Make sure all that the tests pass (i.e. they emit "SUCCESS"). -
      18. -
      -

      Update Documentation

      1. @@ -221,41 +145,18 @@ Enter the following command to build all the source release packages:  archive.bat
      - -

      Verify All Release Packages

      - -
        -
      1. Open a normal command prompt window with "cmd.exe".
      2. - -
      3. Change the current directory to "<root>\Setup".
      4. - -
      5. - Enter the following command to build all the source release packages:  - ..\Externals\Eagle\bin\EagleShell.exe -file verify.eagle Output
        - If errors are generated, the file "<root>\Setup\verify.lst" - may need to be updated to account for the files that have been added and/or - removed from the release archives since the previous release. -
      6. -
      -

      Update Downloads Page

      1. Open a normal command prompt window with "cmd.exe".
      2. Change the current directory to "<root>\Setup".
      3. -
      4. - Replace the version numbers for the previous release in the local working - copy of the [./downloads.wiki | downloads page] with the new version numbers - for System.Data.SQLite and the SQLite core. -
      5. -
      6. Enter the following command to update the sizes and hashes on the downloads page based on all the built release packages: tclsh.exe  updateFileInfo.tcl
        This assumes that [http://www.activestate.com/activetcl | ActiveTcl] version 8.4 or later has Index: www/support.wiki ================================================================== --- www/support.wiki +++ www/support.wiki @@ -71,11 +71,11 @@