diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-05-22 09:08:19 -0400 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-05-22 09:08:19 -0400 |
commit | 5dbe8aa92b9e746962b43f9a24b10d7f9616d232 (patch) | |
tree | 3a99baca5a9f27bb3914ef9ee082eb4d2d6d84fc /includes/database/mysql | |
parent | c88f2e0188e48f4c4adfb101d70733a0b27d4685 (diff) | |
parent | 267b9c435c5d7266f4ce674b84d95bfe1f5a0920 (diff) | |
download | brdo-5dbe8aa92b9e746962b43f9a24b10d7f9616d232.tar.gz brdo-5dbe8aa92b9e746962b43f9a24b10d7f9616d232.tar.bz2 |
Merge branch '7.x' of git.drupal.org:project/drupal into 7.x
Diffstat (limited to 'includes/database/mysql')
-rw-r--r-- | includes/database/mysql/query.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/database/mysql/query.inc b/includes/database/mysql/query.inc index f7fb52f04..888b6a5a4 100644 --- a/includes/database/mysql/query.inc +++ b/includes/database/mysql/query.inc @@ -42,8 +42,8 @@ class InsertQuery_mysql extends InsertQuery { } public function __toString() { - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a sanitized comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); // Default fields are always placed first for consistency. $insert_fields = array_merge($this->defaultFields, $this->insertFields); @@ -92,8 +92,8 @@ class TruncateQuery_mysql extends TruncateQuery { // not transactional, and result in an implicit COMMIT. When we are in a // transaction, fallback to the slower, but transactional, DELETE. if ($this->connection->inTransaction()) { - // Create a comments string to prepend to the query. - $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // Create a comment string to prepend to the query. + $comments = $this->connection->makeComment($this->comments); return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '}'; } else { |