summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-06-05 02:06:51 +0200
committerSergei Golubchik <serg@mariadb.org>2015-06-05 02:06:51 +0200
commitf84f577aa15a193f24c3119eafdee554cb9775fb (patch)
treeee531580839374516db09b2409ec4bd57a847e8a /sql/item_sum.cc
parentf07b3463e7a4ff32316e1cc94d553b5009ac51f2 (diff)
parent31c803e8d0543b330aa8e61ef878da43fe1f68f7 (diff)
downloadmariadb-git-f84f577aa15a193f24c3119eafdee554cb9775fb.tar.gz
Merge tag 'mysql-5.5.44' into bb-5.5-serg
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 27456a94543..d8970ca26b5 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2008, 2014, SkySQL Ab.
+/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3294,7 +3294,19 @@ void Item_func_group_concat::cleanup()
}
DBUG_ASSERT(tree == 0);
}
-
+ /*
+ As the ORDER structures pointed to by the elements of the
+ 'order' array may be modified in find_order_in_list() called
+ from Item_func_group_concat::setup() to point to runtime
+ created objects, we need to reset them back to the original
+ arguments of the function.
+ */
+ ORDER **order_ptr= order;
+ for (uint i= 0; i < arg_count_order; i++)
+ {
+ (*order_ptr)->item= &args[arg_count_field + i];
+ order_ptr++;
+ }
DBUG_VOID_RETURN;
}