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

FIX Escape wildcard characters when matching database name in databaseExists #8769

Merged

Conversation

ScopeyNZ
Copy link
Member

@ScopeyNZ ScopeyNZ commented Jan 29, 2019

Currently it's possible that databaseExists may return true when a database does not exist if a database name like my_database is being checked when a database named my-database already exists. We should escape wildcard characters - apparently even % is a valid character for table names 😰

Copy link
Contributor

@robbieaverill robbieaverill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that MySQLi and PDO don't handle this correctly out of the box to be honest, but the change looks good to me

@robbieaverill robbieaverill merged commit a104b5b into silverstripe:4.0 Feb 10, 2019
@robbieaverill robbieaverill deleted the pulls/4.0/escape_for_like branch February 10, 2019 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants