EmpaticoOrg / scenic-mysql_adapter

MySQL adapter for thoughtbot/scenic
MIT License
30 stars 15 forks source link

Generate correct view definition if a table shares its name with the database #4

Open adamors opened 6 years ago

adamors commented 6 years ago

Fix for #3

The regex looks for either a space, an open brace or a comma before the database name, avoiding matching substrings where the database name appears twice.

cainlevy commented 6 years ago

It sounds like you did a fair bit of research on this to identify a mysql bug, etc., so I'd like to document the variations in code with a few test cases. My best idea is extracting the sanitization (normalization?) logic here into a utility method that can be tested without installing each example version of MySQL. Thoughts?

cainlevy commented 6 years ago

@adamors Would it be helpful if I extracted the utility method? I'm not positive what the test cases should be, though.