mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-02 12:34:59 +02: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
@ -292,12 +292,24 @@ class acm_memory
|
||||
// determine which tables this query belongs to
|
||||
// Some queries use backticks, namely the get_database_size() query
|
||||
// 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.
|
||||
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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user