summaryrefslogtreecommitdiff
path: root/includes/database/query.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-12-26 14:23:38 +0000
committerDries Buytaert <dries@buytaert.net>2008-12-26 14:23:38 +0000
commit0d100b57dcffe54ec7f46d8f577a4c26fcf34202 (patch)
treeffcfb6c4cb5e1f9481479620c87b37a2c7b6ebec /includes/database/query.inc
parentfc063806de3ded56d1c3d78a49e8a60de7a7fe1c (diff)
downloadbrdo-0d100b57dcffe54ec7f46d8f577a4c26fcf34202.tar.gz
brdo-0d100b57dcffe54ec7f46d8f577a4c26fcf34202.tar.bz2
- Patch #332002 by Crell et al: MergeQuery should refuse to execute if there are no key fields. With tests.
Diffstat (limited to 'includes/database/query.inc')
-rw-r--r--includes/database/query.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/includes/database/query.inc b/includes/database/query.inc
index 396b59afb..c8e312dec 100644
--- a/includes/database/query.inc
+++ b/includes/database/query.inc
@@ -635,6 +635,11 @@ class MergeQuery extends Query {
public function execute() {
+ // A merge query without any key field is invalid.
+ if (count($this->keyFields) == 0) {
+ throw new InvalidMergeQueryException("You need to specify key fields before executing a merge query");
+ }
+
// In the degenerate case of this query type, we have to run multiple
// queries as there is no universal single-query mechanism that will work.
// Our degenerate case is not designed for performance efficiency but