TestTranspile_QuerySourceShow asserts `SHOW duckgres.query_source` is intercepted (answered session-side) rather than treated as an unrecognized config parameter or forwarded to DuckDB.
(t *testing.T)
| 45 | if result.QuerySourceShow { |
| 46 | t.Errorf("Transpile(%q): QuerySourceShow = true, want false", tt.input) |
| 47 | } |
| 48 | }) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | // TestTranspile_QuerySourceSetInvalidRejected asserts that a SET with a value |
| 53 | // outside the closed {standard, endpoints} set surfaces Result.Error with |
| 54 | // SQLSTATE 22023 (invalid_parameter_value) and does NOT populate |
| 55 | // QuerySourceSet. The value is the billing-bucket key, so accepting arbitrary |
| 56 | // strings would hand clients unbounded cardinality (and junk) in the billing |
| 57 | // table and its exports. The error message must name the valid values but must |
| 58 | // NOT echo the offending value (arbitrary client input flowing into logs / the |
| 59 | // recent-errors ring). |
| 60 | func TestTranspile_QuerySourceSetInvalidRejected(t *testing.T) { |
| 61 | tr := New(DefaultConfig()) |
| 62 | |
| 63 | longJunk := strings.Repeat("x", 10*1024) |
| 64 | inputs := map[string]string{ |
| 65 | "garbage": "SET duckgres.query_source = 'garbage'", |
nothing calls this directly
no test coverage detected