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

#315047 by Josh Waihi: Escape PostgreSQL column names in the changeField function.

parent b0ccdd86
No related branches found
No related tags found
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
...@@ -547,7 +547,7 @@ public function dropIndex(&$ret, $table, $name) { ...@@ -547,7 +547,7 @@ public function dropIndex(&$ret, $table, $name) {
* table specification but without the 'fields' element. * table specification but without the 'fields' element.
*/ */
public function changeField(&$ret, $table, $field, $field_new, $spec, $new_keys = array()) { public function changeField(&$ret, $table, $field, $field_new, $spec, $new_keys = array()) {
$ret[] = update_sql("ALTER TABLE {" . $table . "} RENAME $field TO " . $field . "_old"); $ret[] = update_sql('ALTER TABLE {' . $table . '} RENAME "' . $field . '" TO "' . $field . '_old"');
$not_null = isset($spec['not null']) ? $spec['not null'] : FALSE; $not_null = isset($spec['not null']) ? $spec['not null'] : FALSE;
unset($spec['not null']); unset($spec['not null']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment