edgedb icon indicating copy to clipboard operation
edgedb copied to clipboard

InternalServerError: function return row and query-specified return row do not match

Open MicroDroid opened this issue 3 years ago • 1 comments

  • EdgeDB Version: Docker image tagged version "2"
  • OS Version: Arch Linux
  1. Setup a new EdgeDB project
  2. Migrate to this schema:
module default {
	scalar type Color extending enum<Green, NotGreen>;

	type Vegetable {
		required property name -> str;
		required property color -> Color;
	}

	type Cart {
		required property color -> Color;

		multi link items -> BaseObject {
			property objectType := str_split(.__type__.name, '::')[1];
		};
	}
}
  1. Insert some data:
insert Vegetable { name := "Cabbage", color := Color.Green };
insert Cart { color := Color.NotGreen, items := (select Vegetable) };
  1. Make it crash with this query:
with
	Carts := (
		select (
			with Carts := (select Cart)
			group Carts
			by .color
		) {
			carts := (
				select .elements {
					id,
					items: {
						id,
						@objectType
					},
					color
				}
			),
		}
	)
select Carts {
	carts := Carts.carts,
};

It seems like the @objectType is a problematic property.

MicroDroid avatar Sep 13 '22 13:09 MicroDroid

Probably materialization related

msullivan avatar Sep 16 '22 17:09 msullivan

This seems fixed?

msullivan avatar Mar 28 '24 01:03 msullivan