featurebase/sql3/test/defs
Seebs 853bc71a9e handle integers as comparisons for decimal fields
It's reasonable to allow "where x > 13" on decimal
fields. Handle at least int64 and float64.

Once this is up, we find that aggregates can return
non-values, such as nil, in some cases; for instance,
`percentile(x) where x > 13` can yield a nil if x is
never greater than 13, rather than making up a value
from zero data points. So we accept nil as a valid
result type in PQL aggregates.

As a result of this, change two tests which were
unintentionally testing for an arcane edge case bug
in which (1) we can't render a condition to PQL,
such as because you specified an integer for a decimal
field, and (2) the filter is using an aliased name,
in which we would end up failing to generate a PQL
filter, but *also* losing the SQL-layer filter, and
produce wrong results as though there were no filter.

We also alter the tests to use `o.price > 9`, because
this lets us generate three user names, but only two
distinct user names, so the test using DISTINCT returns
a different value than the test not using DISTINCT,
which helps us verify that it's actually working and
not just lucky.

As part of fixing that, there was an intermediate
state where we rejected as an error any case where
generating the PQL filter failed. This broke 21 more
test cases, but in all of those cases, the SQL filter
was actually working.

... But in two of them, we SHOULD have been able to
generate PQL, because they were testing bools for
null, which works fine. We just had a list of
field types we allowed null tests against and
omitted bool because I forgot that bool isn't always
just treated as a kind of mutex.
2023-04-07 14:41:01 -05:00
..
defs.go implemented query hints (flatten) (fb-2124) (#2373) 2023-04-06 17:28:24 -05:00
defs_aggregate.go create model, create function... all the goodies (#2264) 2023-04-04 17:44:29 -05:00
defs_between.go A bug fix roundup (#2242) 2023-02-13 12:28:34 -06:00
defs_binops.go SQL3 Test Coverage: complete coerceValue coverage (#2343) 2023-03-24 13:33:05 -05:00
defs_bool.go Introduce ServiceManager and Refactor DAX Integration tests (#2320) 2022-12-12 09:01:20 -08:00
defs_bulkinsert.go create model, create function... all the goodies (#2264) 2023-04-04 17:44:29 -05: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_copy.go create model, create function... all the goodies (#2264) 2023-04-04 17:44:29 -05:00
defs_create_table.go don't panic on failed table creation 2023-04-03 16:29:21 -05:00
defs_date_functions.go Added date_trunc time/date scalar function (#2312) 2023-03-10 14:49:47 -06:00
defs_delete.go Add test coverage to expressionanalyzer.go (#2370) 2023-04-06 09:55:09 -05: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 implemented query hints (flatten) (fb-2124) (#2373) 2023-04-06 17:28:24 -05:00
defs_having.go fb-2049 improve test coverage for select statement (#2339) 2023-03-23 11:10:57 -04:00
defs_in.go Add test coverage to expressionanalyzer.go (#2370) 2023-04-06 09:55:09 -05: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 handle integers as comparisons for decimal fields 2023-04-07 14:41:01 -05: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 Add HasDirective to dax.Node struct to force Directive on restart (#2335) 2023-03-21 13:22:16 -05: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 SQL3 Test Coverage: complete coerceValue coverage (#2343) 2023-03-24 13:33:05 -05:00
defs_set_functions.go fb-2040 (#2354) 2023-03-28 16:59:00 -04:00
defs_sql1.go forward-port tests from SQL1 tree (#2261) 2023-03-01 13:40:50 -06:00
defs_string_functions.go Add SQL3 tests - /planner/inbuiltfunctionsstring.go (#2331) 2023-03-20 17:04:27 -04:00
defs_subquery.go fix sum aggregate (fb-1874) (#2404) 2023-01-12 00:49:58 +00:00
defs_timequantum.go Add tests cases for coverage in expressiontypes.go (#2345) 2023-03-23 14:17:06 -05:00
defs_timestamp_literals.go Change datepart function to datetimepart (#2303) 2023-03-09 13:04:38 -06:00
defs_top.go implemented query hints (flatten) (fb-2124) (#2373) 2023-04-06 17:28:24 -05: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 fb-2036 improve coverage for create view statement (#2333) 2023-03-21 14:06:38 -04:00
types.go support null/non-null tests for non-BSI fields 2023-03-24 16:01:09 -05:00