Skip to content

Commit

Permalink
More types again
Browse files Browse the repository at this point in the history
  • Loading branch information
def- committed Jul 4, 2023
1 parent a8ba158 commit af22a68
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,44 @@ const_expr::const_expr(prod *p, sqltype *type_constraint)
expr = "'{}'::map[text=>text]";
else if (type->name == "anycompatiblemap")
expr = "'{}'::map[text=>text]";
else if (type->name == "text[]")
expr = "array['a', 'b', null, '']::text[]";
else if (type->name == "smallint[]")
expr = "array[1, 2, 3, null]::smallint[]";
else if (type->name == "integer[]")
expr = "array[1, 2, 3, null]::integer[]";
else if (type->name == "jsonb")
if (d42() == 1)
expr = "'{}'::jsonb";
else if (d42() == 1)
expr = "'[]'::jsonb";
else if (d42() == 1)
expr = "'\"foo\"'::jsonb";
else if (d42() == 1)
expr = "'null'::jsonb";
else
expr = "'{\"1\":2,\"3\":4}'::jsonb";
else if (type->name == "bytea")
if (d42() == 1)
expr = "cast('\\000' as bytea)";
else if (d42() == 1)
expr = "cast('\\xFFFFFF' as bytea)";
else
expr = "cast('\\xDEADBEEF' as bytea)";
else if (type->name == "uuid")
if (d42() == 1)
expr = "UUID '00000000-0000-0000-0000-000000000000'";
else if (d42() == 1)
expr = "UUID 'ffffffff-ffff-ffff-ffff-ffffffffffff'";
else
expr = "UUID 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'";
else if (type->name == "date")
if (d42() == 1)
expr = "(DATE '1-11-25' - INTERVAL '4713 YEARS')";
else if (d42() == 1)
expr = "(DATE '62143-12-31' + INTERVAL '200000 YEARS')";
else
expr = "DATE '2007-02-01'";
else if (type->name == "time")
if (d42() == 1)
expr = "TIME '00:00:00'";
Expand Down

0 comments on commit af22a68

Please sign in to comment.