Whole file

David-Wobrock/sqlvalidator

The author described this change as Fix ARRAY_AGG function call with only one arg. It counts as a record because the check below fails on the code as it stood at 3000a4f6d and passes on 7734d5bae, with nothing else changed between the two runs.

Fix saved2021-02-20
Sharing licenceMIT · LICENSE
Change size+4 4

What the code was meant to do, written into the code itself as a save note

Fix ARRAY_AGG function call with only one arg

The change

531531 if self.distinct:
532532 array_agg_str += "DISTINCT "
533533
534- array_agg_str += transform(self.args[0]) + " "
534+ array_agg_str += transform(self.args[0])
535535
536536 if self.ignore_nulls:
537- array_agg_str += "IGNORE NULLS "
537+ array_agg_str += " IGNORE NULLS"
538538 elif self.respect_nulls:
539- array_agg_str += "RESPECT NULLS "
539+ array_agg_str += " RESPECT NULLS"
540540
541541 if self.order_bys:
542- array_agg_str += "ORDER BY{}".format(
542+ array_agg_str += " ORDER BY{}".format(
543543 self.order_bys.transform(allow_linebreak=False)
544544 )
545545

The check that tells the two apart

failpass·tests/integration/test_formatting.py::test_array_agg

Check file tests/integration/test_formatting.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it3000a4f6d3ee387e726b56de94ee82b97e2d9abf
Broken version dated2021-02-20
Modulesqlvalidator.grammar.sql
Units changedArrayAggFunctionCall
Fingerprintf2441febab92b890
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in David-Wobrock/sqlvalidator