-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
too much recursion #4008
Comments
But if I change my comments it works: erDiagram
rental{
~timestamp with time zone~ rental_date "NN"
~integer~ inventory_id "NN"
~integer~ customer_id "NN"
~timestamp with time zone~ return_date
~integer~ staff_id "NN"
~integer~ rental_id "NN"
~timestamp with time zone~ last_update "NN"
}
film_actor{
~integer~ actor_id "NN"
~integer~ film_id "NN"
~timestamp with time zone~ last_update "NN"
}
film{
~text~ title "NN"
~text~ description
~public.year~ release_year
~integer~ language_id "NN"
~integer~ original_language_id
~smallint~ length
~text[]~ special_features
~tsvector~ fulltext "NN"
~integer~ film_id "NN"
~smallint~ rental_duration "NN"
~numeric(4,2)~ rental_rate "NN"
~numeric(5,2)~ replacement_cost "NN"
~public.mpaa_rating~ rating
~timestamp with time zone~ last_update "NN"
}
customer{
~integer~ store_id "NN"
~text~ first_name "NN"
~text~ last_name "NN"
~text~ email
~integer~ address_id "NN"
~integer~ active
~integer~ customer_id "NN"
~boolean~ activebool "NN"
~date~ create_date "NN"
~timestamp with time zone~ last_update
}
film_category{
~integer~ film_id "NN"
~integer~ category_id "NN"
~timestamp with time zone~ last_update "NN"
}
actor{
~text~ first_name "NN"
~text~ last_name "NN"
~integer~ actor_id "NN"
~timestamp with time zone~ last_update "NN"
}
store{
~integer~ manager_staff_id "NN"
~integer~ address_id "NN"
~integer~ store_id "NN"
~timestamp with time zone~ last_update "NN"
}
city{
~text~ city "NN"
~integer~ country_id "NN"
~integer~ city_id "NN"
~timestamp with time zone~ last_update "NN"
}
language{
~character(20)~ name "NN"
~integer~ language_id "NN"
~timestamp with time zone~ last_update "NN"
}
payment{
~integer~ customer_id "NN"
~integer~ staff_id "NN"
~integer~ rental_id "NN"
~numeric(5,2)~ amount "NN"
~timestamp with time zone~ payment_date "NN"
~integer~ payment_id "NN"
}
category{
~text~ name "NN"
~integer~ category_id "NN"
~timestamp with time zone~ last_update "NN"
}
inventory{
~integer~ film_id "NN"
~integer~ store_id "NN"
~integer~ inventory_id "NN"
~timestamp with time zone~ last_update "NN"
}
address{
~text~ address "NN"
~text~ address2
~text~ district "NN"
~integer~ city_id "NN"
~text~ postal_code
~text~ phone "NN"
~integer~ address_id "NN"
~timestamp with time zone~ last_update "NN"
}
staff{
~text~ first_name "NN"
~text~ last_name "NN"
~integer~ address_id "NN"
~text~ email
~integer~ store_id "NN"
~text~ username "NN"
~text~ password
~bytea~ picture
~integer~ staff_id "NN"
~boolean~ active "NN"
~timestamp with time zone~ last_update "NN"
}
country{
~text~ country "NN"
~integer~ country_id "NN"
~timestamp with time zone~ last_update "NN"
}
film_actor }|..|| film : film_actor_film_id_fkey
film_actor }|..|| actor : film_actor_actor_id_fkey
address }|..|| city : address_city_id_fkey
city }|..|| country : city_country_id_fkey
customer }|..|| store : customer_store_id_fkey
customer }|..|| address : customer_address_id_fkey
film }|..|| language : film_original_language_id_fkey
film }|..|| language : film_language_id_fkey
film_category }|..|| film : film_category_film_id_fkey
film_category }|..|| category : film_category_category_id_fkey
inventory }|..|| store : inventory_store_id_fkey
|
I tried to render the current schema of Opencast (Open Source Lecture Capture & Video Management for Education) and I also got "InternalError: too much recursion". The code sample
|
Hi. I just started using mermaid (mmdc 10.2.2) and got the same error. That means that changing spaces like this works: - ~timestamp with time zone~ last_update "NOT NULL"
+ ~timestamp_with_time_zone~ last_update "NOT NULL" The type I tried to go even further and tried to add a failing test to the codebase like: // file: mermaid/packages/mermaid/src/diagrams/er/parser/erDiagram.spec.js
it('should allow an entity with attribute that has a generic type with complex name', function () {
const entity = 'BOOK';
const attribute1 = '~timestamp with time zone~ created_at';
const attribute2 = '~numeric(4,2)~ rating';
erDiagram.parser.parse(`erDiagram\n${entity} {\n${attribute1}\n${attribute2}\n}`);
const entities = erDb.getEntities();
expect(Object.keys(entities).length).toBe(1);
expect(entities[entity].attributes.length).toBe(2);
expect(entities[entity].attributes[0].attributeType).toBe('~timestamp with time zone~');
expect(entities[entity].attributes[1].attributeType).toBe('~numeric(4,2)~');
}); But the test passes fine. So the issue must be somewhere else, but I don't know much about the rendering process. |
Aside from preventing the recursion issue, what is the expected output for using generics in an ERD? @jgreywolf Is it okay to support something like this instead of generics?
|
Tested and this works properly now via #5965 |
I can confirm the bug is gone. Thanks |
Description
When I'm trying to render my ER diagram in live editor or in github preview I have an error "too much recursion"
Steps to reproduce
Screenshots
No response
Code Sample
Setup
All platforms are affected
Additional Context
No response
The text was updated successfully, but these errors were encountered: