featurebase/sql3/parser
Seebs 5dffbccdff add test coverage, fix bugs caught by added test coverage
Note: We now skip a test because we can't pass it but fixing
it is presently beyond my understanding. In parser_test.go,
we skip
	SELECT * FROM X INNER JOIN Y ON true INNER JOIN Z ON false
because if we stringify it, we put the "ON true" in the wrong
place, and end up with something we can't parse.

The main change here is modifying AssertParseStatement and
AssertStatementStringer (and the corresponding Expression
functions) to also verify that they can clone and round-trip,
and that we can walk expressions. This gives us a ton
more coverage of Clone and conversions to string, and caught
a number of subtle typos and missing type switch cases.

Some of the changes are mostly cosmetic, such as only
including optional words when stringifying expressions
or statements if those optional words were present originally,
as shown by the Pos value stored for those words.

We also drop a lot of trailing apostrophes from some of the
parse test cases, which appear to be harmless but won't be
reproduced when converting back to strings.

We also add a number of additional test cases, or add
clauses to existing test cases, to improve coverage of a
lot of error testing. For instance, we added a decimal
field to the tests of show table, and added cases
using KEYPARTITIONS. (Although it doesn't *do* anything.)

Similarly, whenever we create a statement, we check
the behavior of requesting a list of sources from it, to
verify that source finding code at least runs.
2023-02-15 14:34:51 -06:00
..
ast.go add test coverage, fix bugs caught by added test coverage 2023-02-15 14:34:51 -06:00
ast_test.go add test coverage, fix bugs caught by added test coverage 2023-02-15 14:34:51 -06:00
astdatatype.go Sync from private repo to commit 12d608c80d 2022-12-12 09:01:20 -08:00
parser.go add test coverage, fix bugs caught by added test coverage 2023-02-15 14:34:51 -06:00
parser_test.go add test coverage, fix bugs caught by added test coverage 2023-02-15 14:34:51 -06:00
scanner.go fix sum aggregate (fb-1874) (#2404) 2023-01-12 00:49:58 +00:00
scanner_test.go SQL BULK INSERT (fb-1749) (#2291) 2022-11-15 11:33:38 -08:00
token.go Support for setting individual DatabaseOptions (#2231) 2023-02-06 08:50:28 -06:00
token_test.go cleaned up sync from private repo 2022-09-30 11:20:58 -07:00
walk.go implement CREATE/ALTER/DROP VIEW (fb-1592) (#2408) 2023-01-19 21:51:16 +00:00