summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2013-09-06 15:59:19 +0400
committerSergey Vojtovich <svoj@mariadb.org>2013-09-06 15:59:19 +0400
commitbbc9e57981d8aa420d7bcf58e3fb2d7c1bf25ca9 (patch)
tree4840f695abcffc893f8b7d8d9d62d3e1cdf85a1e /sql/sql_union.cc
parent078388f39ca8d6f0b5188cc060a7f0e1c2808d87 (diff)
downloadmariadb-git-bbc9e57981d8aa420d7bcf58e3fb2d7c1bf25ca9.tar.gz
MDEV-4978 - Server cursor is broken with blobs in the select list,
ORDER BY does not work Use "dynamic" row format (instead of "block") for MARIA internal temporary tables created for cursors. With "block" row format MARIA may shuffle rows, with "dynamic" row format records are inserted sequentially (there are no gaps in data file while we fill temporary tables). This is needed to preserve row order when scanning materialized cursors.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 1551a8ff6d6..8a5ec26ba80 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -129,6 +129,7 @@ bool select_union::flush()
table_alias name of the temporary table
bit_fields_as_long convert bit fields to ulonglong
create_table whether to physically create result table
+ keep_row_order keep rows in order as they were inserted
DESCRIPTION
Create a temporary table that is used to store the result of a UNION,
@@ -143,7 +144,8 @@ bool
select_union::create_result_table(THD *thd_arg, List<Item> *column_types,
bool is_union_distinct, ulonglong options,
const char *alias,
- bool bit_fields_as_long, bool create_table)
+ bool bit_fields_as_long, bool create_table,
+ bool keep_row_order)
{
DBUG_ASSERT(table == 0);
tmp_table_param.init();
@@ -153,7 +155,7 @@ select_union::create_result_table(THD *thd_arg, List<Item> *column_types,
if (! (table= create_tmp_table(thd_arg, &tmp_table_param, *column_types,
(ORDER*) 0, is_union_distinct, 1,
options, HA_POS_ERROR, alias,
- !create_table)))
+ !create_table, keep_row_order)))
return TRUE;
table->keys_in_use_for_query.clear_all();