summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <magnus@neptunus.(none)>2004-10-07 11:57:48 +0200
committerunknown <magnus@neptunus.(none)>2004-10-07 11:57:48 +0200
commit77a56a6a9ffb39837e5e8a062ffd9fe3b12e9523 (patch)
tree033dcc041f691f7844a4cb0480bc71445eae8d27 /sql
parenta4475441c46e0f45ec8f8974ff14c17f827bd1de (diff)
downloadmariadb-git-77a56a6a9ffb39837e5e8a062ffd9fe3b12e9523.tar.gz
Initialise "sorted" variable in constructor of QUICK_SELECT. The variable is set to 1 in test_if_skip_sort_order if we decide to optimize "order by" by uinsg index_read.
mysql-test/r/ndb_index_ordered.result: Another test to check the use of "sorted" in combination with reset_bounds() mysql-test/t/ndb_index_ordered.test: Another test to check the use of "sorted" in combination with reset_bounds() sql/ha_ndbcluster.cc: Check that sorted is set to 0 or 1. sql/opt_range.cc: Initialise the sorted variable to zero QUICK_SELECT constructor.
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_ndbcluster.cc3
-rw-r--r--sql/opt_range.cc2
2 files changed, 4 insertions, 1 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 7747fb685fc..218b615b60d 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -1350,6 +1350,9 @@ int ha_ndbcluster::ordered_index_scan(const key_range *start_key,
DBUG_EXECUTE("enter", print_key(start_key, "start_key"););
DBUG_EXECUTE("enter", print_key(end_key, "end_key"););
+
+ // Check that sorted seems to be initialised
+ DBUG_ASSERT(sorted == 0 || sorted == 1);
if(m_active_cursor == 0)
{
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 9c5b0235767..541acc69ec7 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -393,7 +393,7 @@ SQL_SELECT::~SQL_SELECT()
#undef index // Fix for Unixware 7
QUICK_SELECT::QUICK_SELECT(THD *thd, TABLE *table, uint key_nr, bool no_alloc)
- :dont_free(0),error(0),index(key_nr),max_used_key_length(0),
+ :dont_free(0),sorted(0),error(0),index(key_nr),max_used_key_length(0),
used_key_parts(0), head(table), it(ranges),range(0)
{
if (!no_alloc)