MDL-21874 - ddl object names cache. Don't use cache keys anymore. Leads to conflicts.

This commit is contained in:
Eloy Lafuente
2010-03-22 09:24:57 +00:00
parent 155ce5005a
commit 90d07fa496
+4 -1
View File
@@ -949,6 +949,9 @@ abstract class sql_generator {
/// Implement one basic cache to avoid object name duplication
/// along all the request life, but never to return cached results
/// We need this because sql statements are created before executing
/// them, hence names doesn't exist "phisically" yet in DB, so we need
/// to known which ones have been used
if (!isset($used_names)) {
static $used_names = array();
}
@@ -1001,7 +1004,7 @@ abstract class sql_generator {
}
/// Add the name to the cache
$used_names[$tablename.'-'.$fields.'-'.$suffix] = $namewithsuffix;
$used_names[] = $namewithsuffix;
/// Quote it if necessary (reserved words)
$namewithsuffix = $this->getEncQuoted($namewithsuffix);