mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-14679 table/column meta cache is reset on each request and DDL operation.
No need to call it with false parameter but in very exceptional ocasions.
This commit is contained in:
parent
4735315363
commit
f713581bc3
4 changed files with 5 additions and 5 deletions
|
@ -152,7 +152,7 @@ class database_manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get list of fields in table
|
/// Get list of fields in table
|
||||||
$columns = $this->mdb->get_columns($tablename, false);
|
$columns = $this->mdb->get_columns($tablename);
|
||||||
|
|
||||||
$exists = array_key_exists($fieldname, $columns);
|
$exists = array_key_exists($fieldname, $columns);
|
||||||
|
|
||||||
|
@ -1010,7 +1010,7 @@ class database_manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
// a) check for required fields
|
// a) check for required fields
|
||||||
$dbfields = $this->mdb->get_columns($tablename, false);
|
$dbfields = $this->mdb->get_columns($tablename);
|
||||||
$fields = $table->getFields();
|
$fields = $table->getFields();
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
$fieldname = $field->getName();
|
$fieldname = $field->getName();
|
||||||
|
|
|
@ -299,7 +299,7 @@ class mssql_sql_generator extends sql_generator {
|
||||||
$fieldname = $xmldb_field->getName();
|
$fieldname = $xmldb_field->getName();
|
||||||
|
|
||||||
/// Take a look to field metadata
|
/// Take a look to field metadata
|
||||||
$meta = $this->mdb->get_columns($tablename, false);
|
$meta = $this->mdb->get_columns($tablename);
|
||||||
$metac = $meta[$fieldname];
|
$metac = $meta[$fieldname];
|
||||||
$oldmetatype = $metac->meta_type;
|
$oldmetatype = $metac->meta_type;
|
||||||
|
|
||||||
|
|
|
@ -308,7 +308,7 @@ class mysql_sql_generator extends sql_generator {
|
||||||
$tablename = $xmldb_table->getName($xmldb_table);
|
$tablename = $xmldb_table->getName($xmldb_table);
|
||||||
|
|
||||||
/// Fetch all the columns in the table
|
/// Fetch all the columns in the table
|
||||||
if (!$columns = $this->mdb->get_columns($tablename, false)) {
|
if (!$columns = $this->mdb->get_columns($tablename)) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@ class postgres_sql_generator extends sql_generator {
|
||||||
$fieldname = $xmldb_field->getName();
|
$fieldname = $xmldb_field->getName();
|
||||||
|
|
||||||
/// Take a look to field metadata
|
/// Take a look to field metadata
|
||||||
$meta = $this->mdb->get_columns($tablename, false);
|
$meta = $this->mdb->get_columns($tablename);
|
||||||
$metac = $meta[$xmldb_field->getName()];
|
$metac = $meta[$xmldb_field->getName()];
|
||||||
$oldmetatype = $metac->meta_type;
|
$oldmetatype = $metac->meta_type;
|
||||||
$oldlength = $metac->max_length;
|
$oldlength = $metac->max_length;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue