Skip to content
Snippets Groups Projects
Commit 114a7f2c authored by Angie Byron's avatar Angie Byron
Browse files

#471800 follow-up by stella: Fixing comments on MySQL system queries.

parent 2df43894
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -372,11 +372,11 @@ public function getComment($table, $column = NULL) {
if (isset($column)) {
$condition->condition('column_name', $column);
$condition->compile($this->connection);
// Don't use {} around information_schema table.
// Don't use {} around information_schema.columns table.
return db_query("SELECT column_comment FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchField();
}
$condition->compile($this->connection);
// Don't use {} around information_schema table.
// Don't use {} around information_schema.tables table.
$comment = db_query("SELECT table_comment FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
// Work-around for MySQL 5.0 bug http://bugs.mysql.com/bug.php?id=11379
return preg_replace('/; InnoDB free:.*$/', '', $comment);
......
......@@ -51,7 +51,7 @@ public function queryTableInformation($table) {
'blob_fields' => array(),
'sequences' => array(),
);
// Don't use {} around information_schema table.
// Don't use {} around information_schema.columns table.
$result = db_query("SELECT column_name, data_type, column_default FROM information_schema.columns WHERE table_schema = :schema AND table_name = :table AND (data_type = 'bytea' OR (numeric_precision IS NOT NULL AND column_default LIKE :default))", array(':schema' => $schema, ':table' => $table_name, ':default' => '%nextval%'));
foreach ($result as $column) {
if ($column->data_type == 'bytea') {
......
......@@ -187,7 +187,7 @@ public function tableExists($table) {
// concatination for conditionals like this however, we
// couldn't use db_select() here because it would prefix
// information_schema.tables and the query would fail.
// Don't use {} around information_schema table.
// Don't use {} around information_schema.tables table.
return db_query("SELECT table_name FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
}
......@@ -207,7 +207,7 @@ public function findTables($table_expression) {
// concatination for conditionals like this however, we
// couldn't use db_select() here because it would prefix
// information_schema.tables and the query would fail.
// Don't use {} around information_schema table.
// Don't use {} around information_schema.tables table.
return db_query("SELECT table_name FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchAllKeyed(0, 0);
}
......@@ -222,7 +222,7 @@ public function columnExists($table, $column) {
// concatination for conditionals like this however, we
// couldn't use db_select() here because it would prefix
// information_schema.tables and the query would fail.
// Don't use {} around information_schema table.
// Don't use {} around information_schema.columns table.
return db_query("SELECT column_name FROM information_schema.columns WHERE " . (string) $condition, $condition->arguments())->fetchAllKeyed(0, 0);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment