featurebase/sql3/test/defs
seebs b7e9879526
forward-port tests from SQL1 tree (#2261)
This forward-ports a number of tests from the previous SQL
implementation. The porting is approximate in a number of ways,
and not all tests are implemented/tested yet.

In particular, several tests are currently disabled because
we don't support `limit n` constructs.

The tests that were primarily tests of the parser have been
brought forward as parser tests. One of them has been altered
to add parentheses, because our parser interprets
	fld1 between 1 and 3 and fld2 = 2
as:
	fld1 between (1 and 3) and (fld2 = 2)
which is invalid, while the old parser apparently interpreted it
as:
	(fld1 between 1 and 3) and (fld2 = 2)

We have not yet verified the SQL spec's requirements here, but
sqlite agrees with our old parser, not our new parser, so this
may be a regression.

The old tests expected an INNER JOIN to suppress duplicate
values. Our new code does not, which is consistent with other
SQL implementations. This is a change, but the old behavior
appears to have been wrong. (You can still suppress duplicate
values by specifying DISTINCT.)

In the previous implementations, a value like `count(*)` had
`count(*)` as its column name. In the new implementation,
it has an empty string as its column name.

Related to this, the prior implementation allowed you to
write
	select age, count(*) from grouper group by age having count > 1
but the new implementationt requires that to be spelled as
	having count(*) > 1

This is consistent with other SQL implementations, so I think
the new behavior is correct.

The behavior of SHOW COLUMNS and SHOW TABLES has changed, in
that the specific results returned are significantly different.
Perhaps more significantly, the old system spelled the former
query as SHOW FIELDS, rather than SHOW COLUMNS. This may be
considered a regression, in that `SHOW FIELDS` no longer works,
and we should consider whether any hypothetical users might
have been relying on the output of either of these. (I hope
not, the new output is much better.)

Some of the old tests (the ones in handler_test) were accommodated
by adding a couple of specific test cases to existing tests,
specifically:
	* handling timestamp values with `Z` rather than `+00:00`
	* a join with a WHERE clause referring to fields in both
	  source tables

We introduce a new "partial" comparison type, because there's
no way for a test of `SHOW TABLES` to contain a correct table
row, because `SHOW TABLES` includes timestamps from when tables
were created. I'm not sure this is the right way to do this.

We add corresponding changes to dax_test, because the DAX tree
tests against the SQL tests.

We change the returned types of field names and field types to
plain strings, ironically because DAX needs this -- the test code
in the DAX tree is getting them back as plain strings, rather
than as dax.FieldName and dax.BaseType.

The tests using `having` are commented out because they don't
seem to be working, a ticket has been filed for this.

Two of the tests that should return strings are instead returning
untranslated integer IDs, but only for DAX, not for the regular
SQL tests, and the `delete` test has been commented out for
DAX-specific errors. If we merge this, the next step is to
ticket those and address them separately.
2023-03-01 13:40:50 -06:00
..
defs.go forward-port tests from SQL1 tree (#2261) 2023-03-01 13:40:50 -06:00
defs_aggregate.go Aggregation Nation (fb-1955, fb-1887) (#2252) 2023-02-16 10:56:27 -06:00
defs_between.go A bug fix roundup (#2242) 2023-02-13 12:28:34 -06:00
defs_binops.go add test coverage, fix bugs caught by added test coverage 2023-02-15 14:34:51 -06:00
defs_bool.go Introduce ServiceManager and Refactor DAX Integration tests (#2320) 2022-12-12 09:01:20 -08:00
defs_bulkinsert.go timestamp fixes (#2224) 2023-01-25 14:07:15 -06:00
defs_cast.go you should be able to cast an id as a string (#2334) 2022-12-12 09:01:20 -08:00
defs_create_table.go SHOW CREATE TABLE issues (fb-1810) (#2365) 2023-01-10 23:22:58 +00:00
defs_date_functions.go FB-1968 timestamp data type related fixes and enhancements (#2256) 2023-02-24 14:57:17 -05:00
defs_delete.go Implement DELETE (fb 1557) (#2382) 2023-01-10 23:25:08 +00:00
defs_distinct.go fix import paths 2023-01-11 18:59:24 +00:00
defs_filterpredicates.go forward-port tests from SQL1 tree (#2261) 2023-03-01 13:40:50 -06:00
defs_groupby.go Sync from private repo to commit 12d608c80d 2022-12-12 09:01:20 -08:00
defs_having.go implement having; create view experiment (#2357) 2023-01-10 23:20:15 +00:00
defs_in.go Move SQL3 test definitions into sql3/test/defs package (#2289) 2022-11-15 11:33:35 -08:00
defs_inserts.go FB-1968 timestamp data type related fixes and enhancements (#2256) 2023-02-24 14:57:17 -05:00
defs_join.go forward-port tests from SQL1 tree (#2261) 2023-03-01 13:40:50 -06:00
defs_keyed.go Introduce ServiceManager and Refactor DAX Integration tests (#2320) 2022-12-12 09:01:20 -08:00
defs_keyed_insert.go Introduce ServiceManager and Refactor DAX Integration tests (#2320) 2022-12-12 09:01:20 -08:00
defs_like.go implemented extract ddl; tightened up type related stuff (#2329) 2022-12-12 09:01:20 -08:00
defs_minmaxnegative.go Move SQL3 test definitions into sql3/test/defs package (#2289) 2022-11-15 11:33:35 -08:00
defs_null.go Implement DELETE (fb 1557) (#2382) 2023-01-10 23:25:08 +00:00
defs_orderby.go ORDER BY ....what now!? (fb-1954) (#2257) 2023-02-17 13:35:36 -06:00
defs_select.go add test coverage, fix bugs caught by added test coverage 2023-02-15 14:34:51 -06:00
defs_set_functions.go implemented extract ddl; tightened up type related stuff (#2329) 2022-12-12 09:01:20 -08:00
defs_sql1.go forward-port tests from SQL1 tree (#2261) 2023-03-01 13:40:50 -06:00
defs_string_functions.go FB-1862: Implement Str() scalar string function (#2215) 2023-02-14 15:58:36 -05:00
defs_subquery.go fix sum aggregate (fb-1874) (#2404) 2023-01-12 00:49:58 +00:00
defs_timequantum.go add support for time quantum inserts with explicit timestamps (fb-1558) (#2262) 2023-02-17 12:06:46 -06:00
defs_timestamp_literals.go FB-1968 timestamp data type related fixes and enhancements (#2256) 2023-02-24 14:57:17 -05:00
defs_top.go (fb-1779) make optimizer smarter with top operators and aggregate queries (#2323) 2022-12-12 09:01:20 -08:00
defs_unkeyed.go Add Drop Database and Drop Table support (#2208) 2023-01-23 19:59:47 -06:00
defs_unops.go Sync from private repo to commit 12d608c80d 2022-12-12 09:01:20 -08:00
defs_views.go implement CREATE/ALTER/DROP VIEW (fb-1592) (#2408) 2023-01-19 21:51:16 +00:00
types.go forward-port tests from SQL1 tree (#2261) 2023-03-01 13:40:50 -06:00