diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-05-15 07:04:21 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-05-15 07:04:21 +0000 |
commit | 416f87f170cd6d2fe23db676939283cf174ff68c (patch) | |
tree | 8b908b76ac86cabc785ca890c08a2acff241a31a /includes/database/select.inc | |
parent | 520d8e6e9202f53bad53d4bdaf56ac1d78aba2f6 (diff) | |
download | brdo-416f87f170cd6d2fe23db676939283cf174ff68c.tar.gz brdo-416f87f170cd6d2fe23db676939283cf174ff68c.tar.bz2 |
- Patch #785782 by cafuego: support comments in built queries.
Diffstat (limited to 'includes/database/select.inc')
-rw-r--r-- | includes/database/select.inc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/includes/database/select.inc b/includes/database/select.inc index ddb78c69d..5cb4c04f4 100644 --- a/includes/database/select.inc +++ b/includes/database/select.inc @@ -1317,8 +1317,11 @@ class SelectQuery extends Query implements SelectQueryInterface { public function __toString() { + // Create a comments string to prepend to the query. + $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : ''; + // SELECT - $query = 'SELECT '; + $query = $comments . 'SELECT '; if ($this->distinct) { $query .= 'DISTINCT '; } |