Commit Graph

29 Commits

Author SHA1 Message Date
drh
e46ec734c7 Modify the generate_series() table-valued functions so that its first
argument (the START value) is required.  Throw an error if that argument
is not supplied.  In this was the series.c loadable extension can be used
as a demonstration of how to code an xBestIndex function to require certain
parameters.  Compile with -DZERO_ARGUMENT_GENERATE_SERIES to obtain the
legacy behavior.

FossilOrigin-Name: 459d85a2898d6a53f43b4ad48d2f39edd1bbe37a4f97426a5d666c39c52576a4
2021-07-16 17:04:17 +00:00
drh
3d8c92d041 Raise an error on an attempt to rename an eponymous virtual table.
FossilOrigin-Name: c7909e8e0d0577c6109f13c0b14fb565239aae8af8963d659f363e124f3437fc
2021-04-22 18:02:48 +00:00
drh
8103a03607 Fix table-valued functions so that they will work as the right table
in a LEFT JOIN.  Ticket [2ae0c599b735d59e]

FossilOrigin-Name: 2c35d3f67b67a53ead08b1c395e7ca8e5bf65f94a5a962a0562994a3c66c95d9
2019-11-15 00:52:13 +00:00
drh
4a5cff73a7 Fix a parser bug in the use of parentheses around table-valued functions.
FossilOrigin-Name: 58a51123d1a6381cc67d3c64ba3468ec5a92c299ad6fd86de0b843d0ffafb846
2018-12-03 01:47:41 +00:00
drh
9196c81406 Eponymous virtual tables appear to exist in all schemas. This is an alternative
and improved fix to the eponymous virtual table in trigger problem that
was previously addressed by checkin [1fa74930ab56171e].

FossilOrigin-Name: b8d35c4a7c99ce3753761e5b81269d52c3c910c603fa70b72549883ba68bc485
2018-11-05 16:38:10 +00:00
drh
bfbf7d9daa Test case for PRAGMA table_xinfo.
FossilOrigin-Name: 7694b9bc3003db6ba0b41c5029c8f7b84c07724e7a518e835e98b3c46e4ea227
2018-10-01 21:36:38 +00:00
drh
3561dd4afe Update the carray() and remember() extension functions so that they user
the new sqlite3_value_pointer() interface.

FossilOrigin-Name: a99fa94db7185b8eaf3c9b184cb1479f8b3d5781f71f1717a4b3f2dd1d184fe4
2017-06-30 23:46:16 +00:00
drh
59a40db3d2 Improved tests for the carray() table-valued function.
FossilOrigin-Name: 83a099f139aba03edac19c890a0019e922032a25
2017-02-03 15:16:25 +00:00
drh
6bada27205 Prototype for the remember(V,PTR) extension function.
FossilOrigin-Name: f0942c362f45ca1e986e142dbdd3ad957626dfb1
2016-08-09 21:08:42 +00:00
drh
2e3f87ae84 Change the name of the intarray() extension to carray() and give it an
optional third parameter that specifies the datatype as one of 'int32',
'int64', 'double', or 'char*'.  'int32' is the default.

FossilOrigin-Name: a204ba99db34b356acb259189158a32d2df25da0
2016-07-03 02:35:47 +00:00
drh
ba637157ca Fix an off-by-one comparison in the intarray() virtual table. Get the
intarray() virtual table tests working using the legacy makefile.

FossilOrigin-Name: 7c3d441f2a9f642f3d91dcee854a4d16d298bc34
2016-07-02 20:57:06 +00:00
drh
2519b2a3e5 Merge the alternative table-valued function RHS of IN operator implementation
from trunk.

FossilOrigin-Name: 507fdbfb54ce377f0d870260b07d71b797843fcf
2016-07-02 20:51:31 +00:00
drh
5fbab882c0 Add support for table-valued functions on the RHS of an IN operator.
FossilOrigin-Name: ac6000f050ff4efcf8a87f0825077dbf4144f073
2016-07-02 12:08:14 +00:00
drh
2d05331444 Add the ability to have a table-valued function on the RHS of an IN operator.
FossilOrigin-Name: ba1b441b6003808810667d749635fe6b2e8c6165
2016-06-29 06:19:19 +00:00
drh
64131c15ab Another test case for the intarray($PTR,$N) virtual table.
FossilOrigin-Name: 06e1fab7527c6b4330a58f8d8873afaf2d67ae86
2016-06-29 05:08:01 +00:00
drh
4841624ab9 Add a prototype intarray($PTR,$N) table valued function.
FossilOrigin-Name: 233b33382dc70de45f90b6dfdb5785f20b21489e
2016-06-29 05:00:30 +00:00
drh
dbc49161c0 Allow the left-hand side of IN operators on virtual tables to have the
aConstraintUsage[].omit flag clear.

FossilOrigin-Name: 1622623cbbfc4325c53d731aba78ca9c382ec612
2016-03-02 03:28:07 +00:00
drh
202923107d Do not allow table-valued function syntax on ordinary tables and views as those
objects are not table-valued functions.
Fix for ticket [73eba7ba5c7c0fc].

FossilOrigin-Name: ff5716b89f99d9c4568a39f1f52524528a631623
2015-11-21 13:24:46 +00:00
drh
d12b636330 Improved substitution logic in the query flattener. Saves code space, and
(more importantly) works correctly with table-valued functions.

FossilOrigin-Name: 3d0bd95e977db50c314d33ec292f99e0539d7b4a
2015-10-11 19:46:59 +00:00
drh
6230212f4a Do not allow table-valued function syntax to be used on a view.
FossilOrigin-Name: 97cfe346e140e42a604375551f8168276bdbea11
2015-09-19 20:27:08 +00:00
drh
b4d472f609 Eponymous virtual tables exist in the "main" schema only. Enforce this rule.
FossilOrigin-Name: 06f90bb274c4bb0c30585024c8d365d43c4162f2
2015-09-08 20:26:09 +00:00
drh
1f2fc28134 Fix a corner-case bug in table-valued functions. Update the generate_series()
virtual table to increase the performance estimate penalty for being
underspecified.

FossilOrigin-Name: 552bc9cb88bbe54b4cf5fdf66d1217e7a2047110
2015-08-21 17:14:48 +00:00
drh
d8b1bfc6bf Fix corner-case memory management issues in table-valued functions. Change
virtual table handling so that if xDestroy is missing the table is
eponymous only even if xCreate is present.

FossilOrigin-Name: 774e6a14b124bbae4da0e188b62aee9ffb8c3745
2015-08-20 23:21:34 +00:00
drh
d10dbad5e1 Correctly handle empty function argument lists on table-valued functions.
FossilOrigin-Name: a7acc7878b8bb8e27a0da67b2dbb7bd51df4859b
2015-08-20 20:13:37 +00:00
drh
509c3fc004 Fix eponymous virtual tables so that they do not automatically make the first
column the rowid.  Enhance the generate_series virtual table to support rowid.

FossilOrigin-Name: a325a08599759471047e234ef9cfcc3cb110aafd
2015-08-19 19:01:28 +00:00
drh
bc550df32f Improved comments on the generate_series virtual table. Test cases for
ORDER BY rowid DESC with generate_series.

FossilOrigin-Name: fef44c37f31ca9fd7891cecdbe95cc46a987067b
2015-08-19 18:19:49 +00:00
drh
01d230ce05 A list of arguments following a table name translates into equality
constraints against hidden columns in that table.

FossilOrigin-Name: 40e12cfe4c29475417ba89fb637b4c763cf74016
2015-08-19 17:11:37 +00:00
drh
8a48b9c0b1 Minor refactor of the SrcList object so that it is able to hold the argument
list to a table-valued-function in the FROM clause.

FossilOrigin-Name: b919376147597c4b73421abe5788f893baf1560b
2015-08-19 15:20:00 +00:00
drh
398f872d1f Virtual table modules with a null xCreate method act as eponymous-only modules -
they cannot be used in a CREATE VIRTUAL TABLE statement.  Add the series.c
extension that implements a postgres-like generate_series virtual table to
demonstrate this capability.

FossilOrigin-Name: c58426dbd5ea8b8440ebcc1214f79fa63d658216
2015-08-19 13:54:20 +00:00