Skip to content
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

create index statement causes Insight.Database.Schema.SchemaParsingException #52

Open
mozsoyler opened this issue Oct 25, 2015 · 2 comments

Comments

@mozsoyler
Copy link

I want to create an index on a table in a schema as follows:

create index [ad_util_GeneralPurposeTree-IX_Node_ParentId] on [ad_util_GeneralPurposeTree].[Node](ParentId);

But this line causes Insight.Database.Schema.SchemaParsingException to be thrown with the message: Cannot determine the type of the SQL script.

When i comment out this line all works ok.

How can I create an index using Insight.Database.Schema?

@mozsoyler
Copy link
Author

I have found the problem! Parser uses Regex with IgnoreCase option. This likely changes source string character case to upper. But the system language setting is Turkish and the upper case 'i' in Turkish is not 'I', it is 'İ' (I with a dot over it). So 'index' can not be matched. Other keywords which contains 'i' character also can not be matched.

In order to avoid this situation CultureInvariant option could be used but in this case non ASCII characters used in SQL object names possibly will not be matched.

I shall circumvent this using upper case keywords this time and return this problem later. May be I shall manage to suggest something. Nothing to fix on your side for the time being.

Thank you for this excellent migration tool by the way.

@jorgeyanesdiez
Copy link

@mozsoyler Nice find. It's still a bug though, because DDL syntax (i.e: "CREATE INDEX") will always be in English, so it should be matched with the invariant culture as you suggested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants