-
Notifications
You must be signed in to change notification settings - Fork 247
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
Fix crashes caused by CREATE INDEX SQL commands upon DB update by add… #515
Conversation
} | ||
buffer.append("INDEX "); | ||
buffer.append("INDEX IF NOT EXISTS"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can this work? This doesn't leave a space between "EXISTS" and the table name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, the commited version missed the space, the 'IF NOT EXIST ' append was in a separate line when I tested.
This is why the build failed as well. Fixed now.
buffer.append("INDEX "); | ||
buffer.append(table).append("_").append(fields[0]).append("_idx ON "); | ||
buffer.append("INDEX IF NOT EXISTS "); | ||
buffer.append(table).append("_").append(fields[0]).append("_idx ON "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the indentation now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've squashed-rebased now to fix this, please check again.
But finally it turned out what these look like identation changes are: the file has tabs instead of spaces and the IDE keeps them even though the code style uses spaces.
And this notification:
(So in my commit those 2 lines were reformatted for some reason.)
I guess we could fix this in a separate ticket. Turn off that settings and re-format alll project files, to remove the tabs.
…ing IF NOT EXISTS clause. #382
b32aa16
to
bfa59d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now.
…ing IF NOT EXISTS clause. #382
Steps to reproduce the crash:
TaskDatabaseHelper#DATABASE_VERSION = 15
(may also need
allowBackup=false
in manifest)TaskDatabaseHelper#DATABASE_VERSION = 16
Doing the same with this branch should not result in a crash.