mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Although difficult, now all the key/index/sequence/trigger names
are quoted if they are reserved words
This commit is contained in:
parent
134e3128bb
commit
c412278140
@ -327,7 +327,7 @@ class XMLDBgenerator {
|
||||
case XMLDB_KEY_PRIMARY:
|
||||
if ($this->primary_keys) {
|
||||
if ($this->primary_key_name !== null) {
|
||||
$key = $this->primary_key_name;
|
||||
$key = $this->getEncQuoted($this->primary_key_name);
|
||||
} else {
|
||||
$key = $this->getNameForObject($xmldb_table->getName(), implode(', ', $xmldb_key->getFields()), 'pk');
|
||||
}
|
||||
@ -383,6 +383,7 @@ class XMLDBgenerator {
|
||||
|
||||
/**
|
||||
* Given three strings (table name, list of fields (comma separated) and suffix), create the proper object name
|
||||
* quoting it if necessary
|
||||
*/
|
||||
function getNameForObject($tablename, $fields, $suffix) {
|
||||
|
||||
@ -435,6 +436,9 @@ class XMLDBgenerator {
|
||||
/// Add the name to the cache
|
||||
$used_names[] = $namewithsuffix;
|
||||
|
||||
/// Quote it if necessary (reserved words)
|
||||
$namewithsuffix = $this->getEncQuoted($namewithsuffix);
|
||||
|
||||
return $namewithsuffix;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user