You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using MySQL as a DB and having "relation" between two resources in gohan schema, we rely on MySQL's foreign key constraint for validation. With the above limitation, I realized that resource relation could be created with case insensitive manner or ignoring trailing spaces. If we have some backend which resolves resource relation in strict string comparison, the backend cannot find the proper relation and could fail.
For example, if we have a schema like below, we can create resources customer.id = "abc" and device.customer_id = "ABC ". And as a results, backend operation will fail if it tried to resolve customer resource from device.customer_id with strict string comparison.
According to MySQL spec (limitation), MySQL VARCHAR ignores trailing spaces on string comparison.
http://dev.mysql.com/doc/refman/5.7/en/char.html
Also, the comparison is not case sensitive.
http://dev.mysql.com/doc/refman/5.7/en/case-sensitivity.html
Using MySQL as a DB and having "relation" between two resources in gohan schema, we rely on MySQL's foreign key constraint for validation. With the above limitation, I realized that resource relation could be created with case insensitive manner or ignoring trailing spaces. If we have some backend which resolves resource relation in strict string comparison, the backend cannot find the proper relation and could fail.
For example, if we have a schema like below, we can create resources customer.id = "abc" and device.customer_id = "ABC ". And as a results, backend operation will fail if it tried to resolve customer resource from device.customer_id with strict string comparison.
The text was updated successfully, but these errors were encountered: