summaryrefslogtreecommitdiff
path: root/databases/sqlite3/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2021-12-30sqlite3: updated to 3.37.1adam1-2/+1
version 3.37.1 Fix a bug introduced by the UPSERT enhancements of version 3.35.0 that can cause incorrect byte-code to be generated for some obscure but valid SQL, possibly resulting in a NULL-pointer dereference. Fix an OOB read that can occur in FTS5 when reading corrupt database files. Improved robustness of the --safe option in the CLI. Other minor fixes to assert() statements and test cases.
2021-12-08revbump for icu and libffiadam1-1/+2
2021-11-28sqlite3: updated to 3.37.0adam1-2/+1
SQLite Release 3.37.0 On 2021-11-27 STRICT tables provide a prescriptive style of data type management, for developers who prefer that kind of thing. When adding columns that contain a CHECK constraint or a generated column containing a NOT NULL constraint, the ALTER TABLE ADD COLUMN now checks new constraints against preexisting rows in the database and will only proceed if no constraints are violated. Added the PRAGMA table_list statement. CLI enhancements: Add the .connection command, allowing the CLI to keep multiple database connections open at the same time. Add the --safe command-line option that disables dot-commands and SQL statements that might cause side-effects that extend beyond the single database file named on the command-line. Performance improvements when reading SQL statements that span many lines. Added the sqlite3_autovacuum_pages() interface. The sqlite3_deserialize() does not and has never worked for the TEMP database. That limitation is now noted in the documentation. The query planner now omits ORDER BY clauses on subqueries and views if removing those clauses does not change the semantics of the query. The generate_series table-valued function extension is modified so that the first parameter ("START") is now required. This is done as a way to demonstrate how to write table-valued functions with required parameters. The legacy behavior is available using the -DZERO_ARGUMENT_GENERATE_SERIES compile-time option. Added new sqlite3_changes64() and sqlite3_total_changes64() interfaces. Added the SQLITE_OPEN_EXRESCODE flag option to sqlite3_open_v2(). Use less memory to hold the database schema.
2021-10-17sqlite3: fix (disputed) CVE-2021-36690wiz1-1/+2
Bump PKGREVISION.
2021-06-25sqlite3: updated to 3.36.0adam1-2/+1
SQLite Release 3.36.0 On 2021-06-18 Improvement to the EXPLAIN QUERY PLAN output to make it easier to understand. Byte-order marks at the start of a token are skipped as if they were whitespace. An error is raised on any attempt to access the rowid of a VIEW or subquery. Formerly, the rowid of a VIEW would be indeterminate and often would be NULL. The -DSQLITE_ALLOW_ROWID_IN_VIEW compile-time option is available to restore the legacy behavior for applications that need it. The sqlite3_deserialize() and sqlite3_serialize() interfaces are now enabled by default. The -DSQLITE_ENABLE_DESERIALIZE compile-time option is no longer required. Instead, there is is a new -DSQLITE_OMIT_DESERIALIZE compile-time option to omit those interfaces. The "memdb" VFS now allows the same in-memory database to be shared among multiple database connections in the same process as long as the database name begins with "/". Back out the EXISTS-to-IN optimization (item 8b in the SQLite 3.35.0 change log) as it was found to slow down queries more often than speed them up. Improve the constant-propagation optimization so that it works on non-join queries. The REGEXP extension is now included in CLI builds.
2021-04-21revbump for textproc/icuadam1-1/+2
2021-03-15sqlite3: updated to 3.35.0adam1-1/+3
SQLite Release 3.35.0 On 2021-03-12 Added built-in SQL math functions(). (Requires the -DSQLITE_ENABLE_MATH_FUNCTIONS compile-time option.) Added support for ALTER TABLE DROP COLUMN. Generalize UPSERT: Allow multiple ON CONFLICT clauses that are evaluated in order, The final ON CONFLICT clause may omit the conflict target and yet still use DO UPDATE. Add support for the RETURNING clause on DELETE, INSERT, and UPDATE statements. Use less memory when running VACUUM on databases containing very large TEXT or BLOB values. It is no longer necessary to hold the entire TEXT or BLOB in memory all at once. Add support for the MATERIALIZED and NOT MATERIALIZED hints when specifying common table expressions. The default behavior was formerly NOT MATERIALIZED, but is now changed to MATERIALIZED for CTEs that are used more than once. The SQLITE_DBCONFIG_ENABLE_TRIGGER and SQLITE_DBCONFIG_ENABLE_VIEW settings are modified so that they only control triggers and views in the main database schema or in attached database schemas and not in the TEMP schema. TEMP triggers and views are always allowed. Query planner/optimizer improvements: Enhancements to the min/max optimization so that it works better with the IN operator and the OP_SeekScan optimization of the previous release. Attempt to process EXISTS operators in the WHERE clause as if they were IN operators, in cases where this is a valid transformation and seems likely to improve performance. Allow UNION ALL sub-queries to be flattened even if the parent query is a join. Use an index, if appropriate, on IS NOT NULL expressions in the WHERE clause, even if STAT4 is disabled. Expressions of the form "x IS NULL" or "x IS NOT NULL" might be converted to simply FALSE or TRUE, if "x" is a column that has a "NOT NULL" constraint and is not involved in an outer join. Avoid checking foreign key constraints on an UPDATE statement if the UPDATE does not modify any columns associated with the foreign key. Allow WHERE terms to be pushed down into sub-queries that contain window functions, as long as the WHERE term is made up of entirely of constants and copies of expressions found in the PARTITION BY clauses of all window functions in the sub-query. CLI enhancements: Enhance the ".stats" command to accept new arguments "stmt" and "vmstep", causing prepare statement statistics and only the virtual-machine step count to be shown, respectively. Add the ".filectrl data_version" command. Enhance the ".once" and ".output" commands so that if the destination argument begins with "|" (indicating that output is redirected into a pipe) then the argument does not need to be quoted. Bug fixes: Fix a potential NULL pointer dereference when processing a syntactically incorrect SELECT statement with a correlated WHERE clause and a "HAVING 0" clause. (Also fixed in the 3.34.1 patch release.) Fix a bug in the IN-operator optimization of version 3.33.0 that can cause an incorrect answer. Fix incorrect answers from the LIKE operator if the pattern ends with "%" and there is an "ESCAPE '_'" clause.
2020-12-02sqlite3: updated to 3.34.0adam1-2/+1
SQLite Release 3.34.0 Added the sqlite3_txn_state() interface for reporting on the current transaction state of the database connection. Enhance recursive common table expressions to support two or more recursive terms as is done by SQL Server, since this helps make queries against graphs easier to write and faster to execute. Improved error messages on CHECK constraint failures. CLI enhancements: The .read dot-command now accepts a pipeline in addition to a filename. Added options --data-only and --nosys to the .dump dot-command. Added the --nosys option to the .schema dot-command. Table name quoting works correctly for the .import dot-command. The generate_series(START,END,STEP) table-valued function extension is now built into the CLI. The .databases dot-command now show the status of each database file as determined by sqlite3_db_readonly() and sqlite3_txn_state(). Added the --tabs command-line option that sets .mode tabs. The --init option reports an error if the file named as its argument cannot be opened. The --init option also now honors the --bail option. Query planner improvements: Improved estimates for the cost of running a DISTINCT operator. When doing an UPDATE or DELETE using a multi-column index where only a few of the earlier columns of the index are useful for the index lookup, postpone doing the main table seek until after all WHERE clause constraints have been evaluated, in case those constraints can be covered by unused later terms of the index, thus avoiding unnecessary main table seeks. The new OP_SeekScan opcode is used to improve performance of multi-column index look-ups when later columns are constrained by an IN operator. The BEGIN IMMEDIATE and BEGIN EXCLUSIVE commands now work even if one or more attached database files are read-only. Enhanced FTS5 to support trigram indexes. Improved performance of WAL mode locking primitives in cases where there are hundreds of connections all accessing the same database file at once. Enhanced the carray() table-valued function to include a single-argument form that is bound using the auxiliary sqlite3_carray_bind() interface. The substr() SQL function can now also be called "substring()" for compatibility with SQL Server. The syntax diagrams are now implemented as Pikchr scripts and rendered as SVG for improved legibility and ease of maintenance.
2020-11-05*: Recursive revbump from textproc/icu-68.1ryoon1-1/+2
2020-06-05sqlite3: updated to 3.32.2adam1-2/+1
3.32.2: Fix a long-standing bug in the byte-code engine that can cause a COMMIT command report as success when in fact it failed to commit.
2020-06-02Revbump for icuadam1-1/+2
2020-05-23sqlite3: updated to 3.32.0adam1-2/+1
SQLite Release 3.32.0: Added support for approximate ANALYZE using the PRAGMA analysis_limit command. Added the bytecode virtual table. Add the checksum VFS shim to the set of run-time loadable extensions included in the source tree. Added the iif() SQL function. INSERT and UPDATE statements now always apply column affinity before computing CHECK constraints. This bug fix could, in theory, cause problems for legacy databases with unorthodox CHECK constraints the require the input type for an INSERT is different from the declared column type. See ticket 86ba67afafded936 for more information. Added the sqlite3_create_filename(), sqlite3_free_filename(), and sqlite3_database_file_object() interfaces to better support of VFS shim implementations. Increase the default upper bound on the number of parameters from 999 to 32766. Added code for the UINT collating sequence as an optional loadable extension. Enhancements to the CLI: Add options to the .import command: --csv, --ascii, --skip The .dump command now accepts multiple LIKE-pattern arguments and outputs the union of all matching tables. Add the .oom command in debugging builds Add the --bom option to the .excel, .output, and .once commands. Enhance the .filectrl command to support the --schema option. The UINT collating sequence extension is automatically loaded The ESCAPE clause of a LIKE operator now overrides wildcard characters, so that the behavior now matches what PostgreSQL does.
2020-04-12Recursive revision bump after textproc/icu updateadam1-1/+2
2020-01-04sqlite3: remove a workaround that's no longer neededgutteridge1-5/+1
There have been multiple version updates to this package since that was added and it was already fixed upstream.
2019-04-18sqlite3: updated to 3.28.0adam1-2/+1
SQLite Release 3.28.0: Enhanced window functions: Add support the EXCLUDE clause. Add support for window chaining. Add support for GROUPS frames. Add support for "<expr> PRECEDING" and "<expr> FOLLOWING" boundaries in RANGE frames. Added the new sqlite3_stmt_isexplain(S) interface for determining whether or not a prepared statement is an EXPLAIN. Enhanced VACUUM INTO so that it works for read-only databases. New query optimizations: Enable the LIKE optimization for cases when the ESCAPE keyword is present and PRAGMA case_sensitive_like is on. In queries that are driven by a partial index, avoid unnecessary tests of the constraint named in the WHERE clause of the partial index, since we know that constraint must always be true. Enhancements to the TCL Interface: Added the -returntype option to the function method. Added the new bind_fallback method. Enhancements to the CLI: Added support for bound parameters and the .parameter command. Fix the readfile() function so that it returns an empty BLOB rather than throwing an out-of-memory error when reading an empty file. Fix the writefile() function so that when it creates new directories along the path of a new file, it gives them umask permissions rather than the same permissions as the file. Change --update option in the .archive command so that it skips files that are already in the archive and are unchanged. Add the new --insert option that works like --update used to work. Added the fossildelta.c extension that can create, apply, and deconstruct the Fossil DVCS file delta format that is used by the RBU extension. Added the SQLITE_DBCONFIG_WRITABLE_SCHEMA verb for the sqlite3_db_config() interface, that does the same work as PRAGMA writable_schema without using the SQL parser. Added the sqlite3_value_frombind() API for determining if the argument to an SQL function is from a bound parameter. Security and compatibilities enhancements to fts3_tokenizer(): The fts3_tokenizer() function always returns NULL unless either the legacy application-defined FTS3 tokenizers interface are enabled using the sqlite3_db_config(SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER) setting, or unless the first argument to fts3_tokenizer() is a bound parameter. The two-argument version of fts3_tokenizer() accepts a pointer to the tokenizer method object even without the sqlite3_db_config(SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER) setting if the second argument is a bound parameter Improved robustness against corrupt database files. Miscellaneous performance enhancements
2019-04-03Recursive revbump from textproc/icuryoon1-1/+2
2019-02-11sqlite3: updated to 3.27.1adam1-2/+1
SQLite Release 3.27.1: Fix a bug in the query optimizer: an adverse interaction between the OR optimization and the optimization that tries to use values read directly from an expression index instead of recomputing the expression. Hashes: Changes carried forward from version 3.27.0: Added the VACUUM INTO command Issue an SQLITE_WARNING message on the error log if a double-quoted string literal is used. The sqlite3_normalized_sql() interface works on any prepared statement created using sqlite3_prepare_v2() or sqlite3_prepare_v3(). It is no longer necessary to use sqlite3_prepare_v3() with SQLITE_PREPARE_NORMALIZE in order to use sqlite3_normalized_sql(). Added the remove_diacritics=2 option to FTS3 and FTS5. Added the SQLITE_PREPARE_NO_VTAB option to sqlite3_prepare_v3(). Use that option to prevent circular references to shadow tables from causing resource leaks. Enhancements to the sqlite3_deserialize() interface: Add the SQLITE_FCNTL_SIZE_LIMIT file-control for setting an upper bound on the size of the in-memory database created by sqlite3_deserialize. The default upper bound is 1GiB, or whatever alternative value is specified by sqlite3_config(SQLITE_CONFIG_MEMDB_MAXSIZE) and/or SQLITE_MEMDB_DEFAULT_MAXSIZE. Honor the SQLITE_DESERIALIZE_READONLY flag, which was previously described in the documentation, but was previously a no-op. Enhance the "deserialize" command of the TCL Interface to give it new "--maxsize N" and "--readonly BOOLEAN" options. Enhancements to the CLI, mostly to support testing and debugging of the SQLite library itself: Add support for ".open --hexdb". The "dbtotxt" utility program used to generate the text for the "hexdb" is added to the source tree. Add support for the "--maxsize N" option on ".open --deserialize". Add the "--memtrace" command-line option, to show all memory allocations and deallocations. Add the ".eqp trace" option on builds with SQLITE_DEBUG, to enable bytecode program listing with indentation and PRAGMA vdbe_trace all in one step. Add the ".progress" command for accessing the sqlite3_progress_handler() interface. Add the "--async" option to the ".backup" command. Add options "--expanded", "--normalized", "--plain", "--profile", "--row", "--stmt", and "--close" to the ".trace" command. Increased robustness against malicious SQL that is run against a maliciously corrupted database. Bug fixes: Do not use a partial index to do a table scan on an IN operator. Fix the query flattener so that it works on queries that contain subqueries that use window functions. Ensure that ALTER TABLE modifies table and column names embedded in WITH clauses that are part of views and triggers. Fix a parser bug that prevented the use of parentheses around table-valued functions. Fix a problem with the OR optimization on indexes on expressions. Fix a problem with the LEFT JOIN strength reduction optimization in which the optimization was being applied inappropriately due to an IS NOT NULL operator. Fix the REPLACE command so that it is no longer able to sneak a NULL value into a NOT NULL column even if the NOT NULL column has a default value of NULL. Fix a problem with the use of window functions used within correlated subqueries. Fix the ALTER TABLE RENAME COLUMN command so that it works for tables that have redundant UNIQUE constraints. Fix a bug that caused zeroblob values to be truncated when inserted into a table that uses an expression index.
2018-12-09revbump after updating textproc/icuadam1-1/+2
2018-12-09Need pthread support, make sure a substitue is present if OS lacks supportsevan1-1/+2
natively, e.g Minix at present.
2018-09-17sqlite3: updated to 3.25.0adam1-2/+1
SQLite Release 3.25.0: Add support for window functions Enhancements the ALTER TABLE command: - Add support for renaming columns within a table using ALTER TABLE table RENAME COLUMN oldname TO newname. - Fix table rename feature so that it also updates references to the renamed table in triggers and views. Query optimizer improvements: - Avoid unnecessary loads of columns in an aggregate query that are not within an aggregate function and that are not part of the GROUP BY clause. - The IN-early-out optimization: When doing a look-up on a multi-column index and an IN operator is used on a column other than the left-most column, then if no rows match against the first IN value, check to make sure there exist rows that match the columns to the right before continuing with the next IN value. - Use the transitive property to try to propagate constant values within the WHERE clause. For example, convert "a=99 AND b=a" into "a=99 AND b=99". Use a separate mutex on every inode in the unix VFS, rather than a single mutex shared among them all, for slightly better concurrency in multi-threaded environments. Enhance the PRAGMA integrity_check command for improved detection of problems on the page freelist. Output infinity as 1e999 in the ".dump" command of the command-line shell. Added the SQLITE_FCNTL_DATA_VERSION file-control. Added the Geopoly module Bug fixes: The ORDER BY LIMIT optimization might have caused an infinite loop in the byte code of the prepared statement under very obscure circumstances, due to a confluence of minor defects in the query optimizer. On an UPSERT when the order of constraint checks is rearranged, ensure that the affinity transformations on the inserted content occur before any of the constraint checks. Avoid using a prepared statement for ".stats on" command of the CLI after it has been closed by the ".eqp full" logicc. The LIKE optimization was generating incorrect byte-code and hence getting the wrong answer if the left-hand operand has numeric affinity and the right-hand-side pattern is '/%' or if the pattern begins with the ESCAPE character.
2018-07-20Recursive revbump from textproc/icu-62.1ryoon1-1/+2
2018-06-07sqlite3: updated to 3.24.0adam1-2/+1
SQLite Release 3.24.0: Add support for PostgreSQL-style UPSERT. Add support for auxiliary columns in r-tree tables. Add C-language APIs for discovering SQL keywords used by SQLite: sqlite3_keyword_count(), sqlite3_keyword_name(), and sqlite3_keyword_check(). Add C-language APIs for dynamic strings based on the sqlite3_str object. Enhance ALTER TABLE so that it recognizes "true" and "false" as valid arguments to DEFAULT. Add the sorter-reference optimization as a compile-time option. Only available if compiled with SQLITE_ENABLE_SORTER_REFERENCES. Improve the format of the EXPLAIN QUERY PLAN raw output, so that it gives better information about the query plan and about the relationships between the various components of the plan. Added the SQLITE_DBCONFIG_RESET_DATABASE option to the sqlite3_db_config() API. CLI Enhancements: Automatically intercepts the raw EXPLAIN QUERY PLAN output and reformats it into an ASCII-art graph. Lines that begin with "#" and that are not in the middle of an SQL statement are interpreted as comments. Added the --append option to the ".backup" command. Added the ".dbconfig" command. Performance: UPDATE avoids unnecessary low-level disk writes when the contents of the database file do not actually change. For example, "UPDATE t1 SET x=25 WHERE y=?" generates no extra disk I/O if the value in column x is already 25. Similarly, when doing UPDATE on records that span multiple pages, only the subset of pages that actually change are written to disk. This is a low-level performance optimization only and does not affect the behavior of TRIGGERs or other higher level SQL structures. Queries that use ORDER BY and LIMIT now try to avoid computing rows that cannot possibly come in under the LIMIT. This can greatly improve performance of ORDER BY LIMIT queries, especially when the LIMIT is small relative to the number of unrestricted output rows. The OR optimization is allowed to proceed even if the OR expression has also been converted into an IN expression. Uses of the OR optimization are now also more clearly shown in the EXPLAIN QUERY PLAN output. The query planner is more aggressive about using automatic indexes for views and subqueries for which it is not possible to create a persistent index. Make use of the one-pass UPDATE and DELETE query plans in the R-Tree extension where appropriate. Performance improvements in the LEMON-generated parser. Bug fixes: For the right-hand table of a LEFT JOIN, compute the values of expressions directly rather than loading precomputed values out of an expression index as the expression index might not contain the correct value. Do not attempt to use terms from the WHERE clause to enable indexed lookup of the right-hand table of a LEFT JOIN. Fix a memory leak that can occur following a failure to open error in the CSV virtual table Fix a long-standing problem wherein a corrupt schema on the sqlite_sequence table used by AUTOINCREMENT can lead to a crash. Fix the json_each() function so that it returns valid results on its "fullkey" column when the input is a simple value rather than an array or object.
2018-04-14revbump after icu updateadam1-1/+2
2018-04-03sqlite3: updated to 3.23.0adam1-1/+2
SQLite Release 3.23.0: Add the sqlite3_serialize() and sqlite3_deserialize() interfaces when the SQLITE_ENABLE_DESERIALIZE compile-time option is used. Recognize TRUE and FALSE as constants. (For compatibility, if there exist columns named "true" or "false", then the identifiers refer to the columns rather than Boolean constants.) Support operators IS TRUE, IS FALSE, IS NOT TRUE, and IS NOT FALSE. Added the SQLITE_DBSTATUS_CACHE_SPILL option to sqlite3_db_status() for reporting the number of cache spills that have occurred. The "alternate-form-2" flag ("!") on the built-in printf implementation now causes string substitutions to measure the width and precision in characters instead of bytes. If the xColumn method in a virtual table implementation returns an error message using sqlite3_result_error() then give that error message preference over internally-generated messages. Added the -A command-line option to the CLI to make it easier to manage SQLite Archive files. Add support for INSERT OR REPLACE, INSERT OR IGNORE, and UPDATE OR REPLACE in the Zipfile virtual table. Enhance the sqlite3changeset_apply() interface so that it is hardened against attacks from deliberately corrupted changeset objects. Added the sqlite3_normalize() extension function. Query optimizer enhancements: Improve the omit-left-join optimization so that it works in cases where the right-hand table is UNIQUE but not necessarily NOT NULL. Improve the push-down optimization so that it works for many LEFT JOINs. Add the LEFT JOIN strength reduction optimization that converts a LEFT JOIN into an ordinary JOIN if there exist terms in the WHERE clause that would prevent the extra all-NULL row of the LEFT JOIN from appearing in the output set. Avoid unnecessary writes to the sqlite_sequence table when an AUTOINCREMENT table is updated with an rowid that is less than the maximum. Bug fixes: Fix the parser to accept valid row value syntax. Fix the query planner so that it takes into account dependencies in the arguments to table-valued functions in subexpressions in the WHERE clause. Fix incorrect result with complex OR-connected WHERE and STAT4. Fix potential corruption in indexes on expressions due to automatic datatype conversions. Assertion fault in FTS4. Incorrect result on the less-than operator in row values. Always interpret non-zero floating-point values as TRUE, even if the integer part is zero. Fix an issue in the fsdir(PATH) table-valued function to the fileio.c extension, that caused a segfault if the fsdir() table was used as the inner table of a join. Issue an error rather instead of an assertion-fault or null-pointer dereference when the sqlite_master table is corrupted so that the sqlite_sequence table root page is really a btree-index page. Fix the ANALYZE command so that it computes statistics on tables whose names begin with "sqlite". Additional fixes for issues detected by OSSFuzz: Fix a possible infinite loop on VACUUM for corrupt database files. Disallow parameters in the WITH clause of triggers and views. Fix a potential memory leak in row value processing. Improve the performance of the replace() SQL function for cases where there are many substitutions on megabyte-sized strings, in an attempt to avoid OSSFuzz timeouts during testing. Provide an appropriate error message when the sqlite_master table contains a CREATE TABLE AS statement. Formerly this caused either an assertion fault or null pointer dereference. Problem found by OSSFuzz on the GDAL project. Incorrect assert() statement removed. Fix a problem with using the LIKE optimization on an INTEGER PRIMARY KEY.
2018-01-24sqlite3: updated to 3.22.0adam1-2/+1
Release 3.22.0: The output of sqlite3_trace_v2() now shows each individual SQL statement run within a trigger. Add the ability to read from WAL mode databases even if the application lacks write permission on the database and its containing directory, as long as the -shm and -wal files exist in that directory. Added the rtreecheck() scalar SQL function to the R-Tree extension. Added the sqlite3_vtab_nochange() and sqlite3_value_nochange() interfaces to help virtual table implementations optimize UPDATE operations. Added the sqlite3_vtab_collation() interface. Added support for the "^" initial token syntax in FTS5. New extensions: The Zipfile virtual table can read and write a ZIP Archive. Added the fsdir(PATH) table-valued function to the fileio.c extension, for listing the files in a directory. The sqlite_btreeinfo eponymous virtual table for introspecting and estimating the sizes of the btrees in a database. The Append VFS is a VFS shim that allows an SQLite database to be appended to some other file. This allows (for example) a database to be appended to an executable that then opens and reads the database. Query planner enhancements: The optimization that uses an index to quickly compute an aggregate min() or max() is extended to work with indexes on expressions. The decision of whether to implement a FROM-clause subquery as a co-routine or using query flattening now considers whether the result set of the outer query is "complex" (if it contains functions or expression subqueries). A complex result set biases the decision toward the use of co-routines. The planner avoids query plans that use indexes with unknown collating functions. The planner omits unused LEFT JOINs even if they are not the right-most joins of a query. Other performance optimizations: A smaller and faster implementation of text to floating-point conversion subroutine: sqlite3AtoF(). The Lemon parser generator creates a faster parser. Use the strcspn() C-library routine to speed up the LIKE and GLOB operators. Improvements to the command-line shell: The ".schema" command shows the structure of virtual tables. Added support for reading and writing SQL Archive files using the .archive command. Added the experimental .expert command Added the ".eqp trigger" variant of the ".eqp" command Enhance the ".lint fkey-indexes" command so that it works with WITHOUT ROWID tables. If the filename argument to the shell is a ZIP archive rather than an SQLite database, then the shell automatically opens that ZIP archive using the Zipfile virtual table. Added the edit() SQL function. Added the .excel command to simplify exporting database content to a spreadsheet. Databases are opened using Append VFS when the --append flag is used on the command line or with the .open command. Enhance the SQLITE_ENABLE_UPDATE_DELETE_LIMIT compile-time option so that it works for WITHOUT ROWID tables. Provide the sqlite_offset(X) SQL function that returns the byte offset into the database file to the beginning of the record holding value X, when compiling with -DSQLITE_ENABLE_OFFSET_SQL_FUNC. Bug fixes
2017-11-30Revbump after textproc/icu updateadam1-1/+2
2017-10-30sqlite3: updated to 3.21.0adam1-2/+1
Release 3.21.0: Take advantage of the atomic-write capabilities in the F2FS filesystem when available, for greatly reduced transaction overhead. This currently requires the SQLITE_ENABLE_BATCH_ATOMIC_WRITE compile-time option. Allow ATTACH and DETACH commands to work inside of a transaction. Allow WITHOUT ROWID virtual tables to be writable if the PRIMARY KEY contains exactly one column. The "fsync()" that occurs after the header is written in a WAL reset now uses the sync settings for checkpoints. This means it will use a "fullfsync" on macs if PRAGMA checkpoint_fullfsync set on. The sqlite3_sourceid() function tries to detect if the source code has been modified from what is checked into version control and if there are modifications, the last four characters of the version hash are shown as "alt1" or "alt2". The objective is to detect accidental and/or careless edits. A forger can subvert this feature. Improved de-quoting of column names for CREATE TABLE AS statements with an aggregate query on the right-hand side. Fewer "stat()" system calls issued by the unix VFS. Enhanced the LIKE optimization so that it works with an ESCAPE clause. Enhanced PRAGMA integrity_check and PRAGMA quick_check to detect obscure row corruption that they were formerly missing. Also update both pragmas so that they return error text rather than SQLITE_CORRUPT when encountering corruption in records. The query planner now prefers to implement FROM-clause subqueries using co-routines rather using the query flattener optimization. Support for the use of co-routines for subqueries may no longer be disabled. Pass information about !=, IS, IS NOT, NOT NULL, and IS NULL constraints into the xBestIndex method of virtual tables. Enhanced the CSV virtual table so that it accepts the last row of input if the final new-line character is missing. Remove the rarely-used "scratch" memory allocator. Replace it with the SQLITE_CONFIG_SMALL_MALLOC configuration setting that gives SQLite a hint that large memory allocations should be avoided when possible. Added the swarm virtual table to the existing union virtual table extension. Added the sqlite_dbpage virtual table for providing direct access to pages of the database file. The source code is built into the amalgamation and is activated using the -DSQLITE_ENABLE_DBPAGE_VTAB compile-time option. Add a new type of fts5vocab virtual table - "instance" - that provides direct access to an FTS5 full-text index at the lowest possible level. Remove a call to rand_s() in the Windows VFS since it was causing problems in Firefox on some older laptops. The src/shell.c source code to the command-line shell is no longer under version control. That file is now generated as part of the build process. Miscellaneous microoptimizations reduce CPU usage by about 2.1%. Bug fixes
2017-09-18revbump for requiring ICU 59.xmaya1-1/+2
2017-05-24SQLite Release 3.19.0adam1-2/+1
--------------------- The SQLITE_READ authorizer callback is invoked once with a column name that is an empty string for every table referenced in a query from which no columns are extracted. When using an index on an expression, try to use expression values already available in the index, rather than loading the original columns and recomputing the expression. Enhance the flattening optimization so that it is able to flatten views on the right-hand side of a LEFT JOIN. Use replace() instead of char() for escaping newline and carriage-return characters embedded in strings in the .dump output from the command-line shell. Avoid unnecessary foreign key processing in UPDATE statements that do not touch the columns that are constrained by the foreign keys. On a DISTINCT query that uses an index, try to skip ahead to the next distinct entry using the index rather than stepping through rows, when an appropriate index is available. Avoid unnecessary invalidation of sqlite3_blob handles when making changes to unrelated tables. Transfer any terms of the HAVING clause that use only columns mentioned in the GROUP BY clause over to the WHERE clause for faster processing. Reuse the same materialization of a VIEW if that VIEW appears more than once in the same query. Enhance PRAGMA integrity_check so that it identifies tables that have two or more rows with the same rowid. Enhance the FTS5 query syntax so that column filters may be applied to arbitrary expressions. Enhance the json_extract() function to cache and reuse parses of JSON input text. Added the anycollseq.c loadable extension that allows a generic SQLite database connection to read a schema that contains unknown and/or application-specific collating sequences. Bug Fixes: ---------- Fix a problem in REPLACE that can result in a corrupt database containing two or more rows with the same rowid. Fix a problem in PRAGMA integrity_check that was causing a subsequent VACUUM to behave suboptimally. Fix the PRAGMA foreign_key_check command so that it works correctly with foreign keys on WITHOUT ROWID tables. Disallow leading zeros in numeric constants in JSON. Disallow control characters inside of strings in JSON. Limit the depth of recursion for JSON objects and arrays in order to avoid excess stack usage in the recursive descent parser.
2017-04-22Revbump after icu updateadam1-1/+2
2017-02-23Add workaround for build issue on Darwin, to be removed in the next update.jperkin1-1/+5
2017-02-13SQLite Release 3.17.0 On 2017-02-13adam1-3/+1
* Approximately 25% better performance from the R-Tree extension. * Uses compiler built-ins (ex: __builtin_bswap32() or _byteswap_ulong()) for byteswapping when available. * Uses the sqlite3_blob key/value access object instead of SQL for pulling content out of R-Tree nodes * Other miscellaneous enhancements such as loop unrolling. * Add the SQLITE_DEFAULT_LOOKASIDE compile-time option. * Increase the default lookaside size from 512,125 to 1200,100 as this provides better performance while only adding 56KB of extra memory per connection. Memory-sensitive applications can restore the old default at compile-time, start-time, or run-time. * Use compiler built-ins __builtin_sub_overflow(), __builtin_add_overflow(), and __builtin_mul_overflow() when available. (All compiler built-ins can be omitted with the SQLITE_DISABLE_INTRINSIC compile-time option.) * Added the SQLITE_ENABLE_NULL_TRIM compile-time option, which can result in significantly smaller database files for some applications, at the risk of being incompatible with older versions of SQLite. * Change SQLITE_DEFAULT_PCACHE_INITSZ from 100 to 20, for improved performance. * Added the SQLITE_UINT64_TYPE compile-time option as an analog to SQLITE_INT64_TYPE. * Perform some UPDATE operations in a single pass instead of in two passes. * Enhance the session extension to support WITHOUT ROWID tables. * Fixed performance problems and potential stack overflows when creating views from multi-row VALUES clauses with hundreds of thousands of rows. * Added the sha1.c extension. * In the command-line shell, enhance the ".mode" command so that it restores the default column and row separators for modes "line", "list", "column", and "tcl". * Enhance the SQLITE_DIRECT_OVERFLOW_READ option so that it works in WAL mode as long as the pages being read are not in the WAL file. * Enhance the LEMON parser generator so that it can store the parser object as a stack variable rather than allocating space from the heap and make use of that enhancement in the amalgamation. * Other performance improvements. Uses about 6.5% fewer CPU cycles. Bug Fixes: * Throw an error if the ON clause of a LEFT JOIN references tables to the right of the ON clause. This is the same behavior as PostgreSQL. Formerly, SQLite silently converted the LEFT JOIN into an INNER JOIN. * Use the correct affinity for columns of automatic indexes. * Ensure that the sqlite3_blob_reopen() interface can correctly handle short rows.
2017-01-02SQLite Release 3.16.0 On 2017-01-02adam1-2/+1
Uses 9% fewer CPU cycles. (See the CPU performance measurement report for details on how the this performance increase was computed.) Added experimental support for PRAGMA functions. Added the SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option to sqlite3_db_config(). Enhance the date and time functions so that the 'unixepoch' modifier works for the full span of supported dates. Changed the default configuration of the lookaside memory allocator from 500 slots of 128 bytes each into 125 slots of 512 bytes each. Enhanced "WHERE x NOT NULL" partial indexes so that they are usable if the "x" column appears in a LIKE or GLOB operator. Enhanced sqlite3_interrupt() so that it interrupts checkpoint operations that are in process. Enhanced the LIKE and GLOB matching algorithm to be faster for cases when the pattern contains multiple wildcards. Added the SQLITE_FCNTL_WIN32_GET_HANDLE file control opcode. Added ".mode quote" to the command-line shell. Added ".lint fkey-indexes" to the command-line shell. Added the .imposter dot-command to the command-line shell. Added the remember(V,PTR) SQL function as a loadable extension. Rename the SQLITE_OMIT_BUILTIN_TEST compile-time option to SQLITE_UNTESTABLE to better reflect the implications of using it. Bug Fixes: Fix a long-standing bug in the query planner that caused incorrect results on a LEFT JOIN where the left-hand table is a subquery and the join constraint is a bare column name coming from the left-hand subquery. Ticket 2df0107b. Correctly handle the integer literal -0x8000000000000000 in the query planner.
2016-12-12Do not unconditionally add libedit/libreadline to LDFLAGS.wiz1-12/+2
This way they got added as dependencies to sqlite3.so, while only the sqlite3 binary really needs libreadline. However, even without the LDFLAGS, the sqlite3 binary correctly links the library in for me (on NetBSD). Addresses PR 50776. Bump PKGREVISION.
2016-12-04Recursive revbump from textproc/icu 58.1ryoon1-1/+2
2016-10-22Upgrade lemon 1.0 from sqlite 3.5.9 to lemon 1.0 from sqlite 3.15.0kamil1-1/+3
pkgsrc changes ============== Bind this package with databases/sqlite3 to get immediate updates along with the sqlite3 package. Set new versioning policy and concatenate versions of lemon and sqlite3. The reasoning for it is as follows: - currently lemon is an integral part of sqlite3 - lemon has its own conservative versioning regardless of changes in its code - leave room for possible standalone lemon package with bumped versions - reflect reality and make it human readable without checking the sources Set LICENSE to public-domain. Install documentation in the HTML format. Compile with LDFLAGS set. Finally don't use databases/sqlite3/Makefile.common as lemon is not distributed in the same archive. Make use of Makefile.version that does the same job of tracking upstream. Do not set PKGCONFIG_OVERRIDE in Makefile.common, it is not accessible in sqlite3-tcl. Upstream changelog ================== Changes are unknown, but at least the program acquired a -T command line option used by brlcad.
2016-10-21Add sqlite3/Makefile.common for sqlite3 packages to share codekamil1-8/+6
The intention is to reuse Makefile.common in devel/lemon. Replace ${IS_BUILTIN.editline} == "yes" with !empty(IS_BUILTIN.editline:M[yY][eE][sS])
2016-04-20Changes 3.12.2:adam1-2/+1
Fix a backwards compatibility problem in version 3.12.0 and 3.12.1: Columns declared as "INTEGER" PRIMARY KEY (with quotes around the datatype keyword) where not being recognized as an INTEGER PRIMARY KEY, which resulted in an incompatible database file. Fix a bug (present since version 3.9.0) that can cause the DELETE operation to miss rows if PRAGMA reverse_unordered_selects is turned on. Fix a bug in the code generator that can causes incorrect results if two or more virtual tables are joined and the virtual table used in outer loop of the join has an IN operator constraint. Correctly interpret negative "PRAGMA cache_size" values when determining the cache size used for sorting large amounts of data.
2016-04-11Recursive revbump from textproc/icu 57.1ryoon1-1/+2
2016-03-21Fix FreeBSD build, apply patch in PR pkg/50776ryoon1-1/+3
2016-03-06Switch to dynamically-linked shelladam1-6/+2
2016-01-23Fix build on DragonFly 4.4.1ryoon1-1/+3
2016-01-08Fix READLINE_TYPE=readline caseryoon1-5/+5
2016-01-08Use LDFLAGS instead of LIBSryoon1-2/+2
2016-01-08On NetBSD-current, libedit provides readline-like interface. Fix buildryoon1-1/+7
2016-01-08Changes 3.10.0:adam1-3/+1
General improvements: --------------------- Added support for LIKE, GLOB, and REGEXP operators on virtual tables. Added the colUsed field to sqlite3_index_info for use by the sqlite3_module.xBestIndex method. Enhance the PRAGMA cache_spill statement to accept a 32-bit integer parameter which is the threshold below which cache spilling is prohibited. On unix, if a symlink to a database file is opened, then the corresponding journal files are based on the actual filename, not the symlink name. Added the "--transaction" option to sqldiff. Added the sqlite3_db_cacheflush() interface. Added the sqlite3_strlike() interface. When using memory-mapped I/O map the database file read-only so that stray pointers and/or array overruns in the application cannot accidently modify the database file. Added the experimental sqlite3_snapshot_get(), sqlite3_snapshot_open(), and sqlite3_snapshot_free() interfaces. These are subject to change or removal in a subsequent release. Enhance the 'utc' modifier in the date and time functions so that it is a no-op if the date/time is known to already be in UTC. (This is not a compatibility break since the behavior has long been documented as "undefined" in that case.) Added the json_group_array() and json_group_object() SQL functions in the json extension. Added the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option. Many small performance optimizations. Portability enhancements: ------------------------- Work around a sign-exension bug in the optimizer of the HP C compiler on HP/UX. (details) Enhancements to the command-line shell: --------------------------------------- Added the ".changes ON|OFF" and ".vfsinfo" dot-commands. Translate between MBCS and UTF8 when running in cmd.exe on Windows. Enhancements to makefiles: -------------------------- Added the --enable-editline and --enable-static-shell options to the various autoconf-generated configure scripts. Omit all use of "awk" in the makefiles, to make building easier for MSVC users. Important fixes: ---------------- Fix inconsistent integer to floating-point comparison operations that could result in a corrupt index if the index is created on a table column that contains both large integers and floating point values of similar magnitude. Ticket 38a97a87a6. Fix an infinite-loop in the query planner that could occur on malformed common table expressions. Various bug fixes in the sqldiff tool.
2015-10-15Changes 3.9.0:adam1-2/+1
Policy Changes: * The version numbering conventions for SQLite are revised to use the emerging standard of semantic versioning. New Features And Enhancements: * Added the json1 extension module in the source tree, and in the amalgamation. Enable support using the SQLITE_ENABLE_JSON1 compile-time option. * Added Full Text Search version 5 (FTS5) to the amalgamation, enabled using SQLITE_ENABLE_FTS5. FTS5 will be considered "experimental" (subject to incompatible changes) for at least one more release cycle. * The CREATE VIEW statement now accepts an optional list of column names following the view name. * Added support for indexes on expressions. * Added support for table-valued functions in the FROM clause of a SELECT statement. * Added support for eponymous virtual tables. * A VIEW may now reference undefined tables and functions when initially created. Missing tables and functions are reported when the VIEW is used in a query. * Added the sqlite3_value_subtype() and sqlite3_result_subtype() interfaced (used by the json1 extension). * The query planner is now able to use partial indexes that contain AND-connected terms in the WHERE clause. * The sqlite3_analyzer.exe utility is updated to report the depth of each btree and to show the average fanout for indexes and WITHOUT ROWID tables. * Enhanced the dbstat virtual table so that it can be used as a table-valued function where the argument is the schema to be analyzed. Other changes: * The sqlite3_memory_alarm() interface, which has been deprecated and undocumented for 8 years, is changed into a no-op. Important fixes: * Fixed a critical bug in the SQLite Encryption Extension that could cause the database to become unreadable and unrecoverable if a VACUUM command changed the size of the encryption nonce. * Added a memory barrier in the implementation of sqlite3_initialize() to help ensure that it is thread-safe. * Fix the OR optimization so that it always ignores subplans that do not use an index. * Do not apply the WHERE-clause pushdown optimization on terms that originate in the ON or USING clause of a LEFT JOIN.
2015-10-10Recursive revbump from textproc/icuryoon1-1/+2
2015-05-20Record error message that prompted MAKE_JOBS_SAFE=noabs1-1/+5
2015-05-20Add MAKE_JOBS_SAFE=noabs1-1/+2