mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/11224] SQL cache destroy does not destroy queries to tables joined
https://tracker.phpbb.com/browse/PHPBB3-11224 PHPBB3-11224
This commit is contained in:
parent
cc0446dc17
commit
0c109c9d37
1 changed files with 15 additions and 3 deletions
|
@ -292,12 +292,24 @@ class acm_memory
|
||||||
// determine which tables this query belongs to
|
// determine which tables this query belongs to
|
||||||
// Some queries use backticks, namely the get_database_size() query
|
// Some queries use backticks, namely the get_database_size() query
|
||||||
// don't check for conformity, the SQL would error and not reach here.
|
// don't check for conformity, the SQL would error and not reach here.
|
||||||
if (!preg_match('/FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?/', $query, $regs))
|
if (!preg_match_all('/(?:FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?)|(?:JOIN (`?\\w+`?(?: \\w+)?))/', $query, $regs, PREG_SET_ORDER))
|
||||||
{
|
{
|
||||||
// Bail out if the match fails.
|
// Bail out if the match fails.
|
||||||
return;
|
return $query_result;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tables = array();
|
||||||
|
foreach($regs as $match)
|
||||||
|
{
|
||||||
|
if ($match[0][0] == 'F')
|
||||||
|
{
|
||||||
|
$tables = array_merge($tables, array_map('trim', explode(',', $match[1])));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tables[] = $match[2];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$tables = array_map('trim', explode(',', $regs[1]));
|
|
||||||
|
|
||||||
foreach ($tables as $table_name)
|
foreach ($tables as $table_name)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue