mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Don't mistake \ for _ in dev/build
The query SHOW TABLES LIKE 'some_thing' will match the table some\thing. This causes issues when the namespace separator has changed. The fix is to escape the _s in this LIKE statement, as done here.
This commit is contained in:
parent
6f6a53c17c
commit
59a5eb4308
@ -185,7 +185,8 @@ class MySQLSchemaManager extends DBSchemaManager
|
|||||||
public function hasTable($table)
|
public function hasTable($table)
|
||||||
{
|
{
|
||||||
// MySQLi doesn't like parameterised queries for some queries
|
// MySQLi doesn't like parameterised queries for some queries
|
||||||
$sqlTable = $this->database->quoteString($table);
|
// underscores need to be escaped in a SHOW TABLES LIKE query
|
||||||
|
$sqlTable = str_replace('_', '\\_', $this->database->quoteString($table));
|
||||||
return (bool) ($this->query("SHOW TABLES LIKE $sqlTable")->value());
|
return (bool) ($this->query("SHOW TABLES LIKE $sqlTable")->value());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user