Below is the list of changes that have just been committed into a local
5.0 repository of df. When df does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-02-12 10:05:56+01:00, df@stripped +5 -0
Merge kahlann.erinye.com:/home/df/mysql/build/mysql-5.0-build
into kahlann.erinye.com:/home/df/mysql/build/mysql-5.0-build-work
MERGE: 1.2281.4.16
ndb/include/ndbapi/NdbIndexScanOperation.hpp@stripped, 2007-02-12 10:05:53+01:00,
df@stripped +0 -0
Auto merged
MERGE: 1.21.1.1
ndb/include/ndbapi/NdbScanOperation.hpp@stripped, 2007-02-12 10:05:53+01:00,
df@stripped +0 -0
Auto merged
MERGE: 1.37.1.3
ndb/src/ndbapi/NdbScanOperation.cpp@stripped, 2007-02-12 10:05:53+01:00,
df@stripped +0 -0
Auto merged
MERGE: 1.79.1.2
sql/ha_ndbcluster.cc@stripped, 2007-02-12 10:05:53+01:00, df@stripped +0 -0
Auto merged
MERGE: 1.285.1.10
sql/ha_ndbcluster.h@stripped, 2007-02-12 10:05:54+01:00, df@stripped +0 -0
Auto merged
MERGE: 1.107.1.2
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: df
# Host: kahlann.erinye.com
# Root: /home/df/mysql/build/mysql-5.0-build-work/RESYNC
--- 1.22/ndb/include/ndbapi/NdbIndexScanOperation.hpp 2006-12-23 20:04:10 +01:00
+++ 1.23/ndb/include/ndbapi/NdbIndexScanOperation.hpp 2007-02-12 10:05:53 +01:00
@@ -63,12 +63,14 @@ public:
bool order_by,
bool order_desc = false,
bool read_range_no = false,
- bool keyinfo = false) {
+ bool keyinfo = false,
+ bool multi_range = false) {
Uint32 scan_flags =
(SF_OrderBy & -(Int32)order_by) |
(SF_Descending & -(Int32)order_desc) |
(SF_ReadRangeNo & -(Int32)read_range_no) |
- (SF_KeyInfo & -(Int32)keyinfo);
+ (SF_KeyInfo & -(Int32)keyinfo) |
+ (SF_MultiRange & -(Int32)multi_range);
return readTuples(lock_mode, scan_flags, parallel, batch);
}
--- 1.38/ndb/include/ndbapi/NdbScanOperation.hpp 2006-12-23 20:04:11 +01:00
+++ 1.39/ndb/include/ndbapi/NdbScanOperation.hpp 2007-02-12 10:05:53 +01:00
@@ -37,13 +37,15 @@ class NdbScanOperation : public NdbOpera
public:
/**
* Scan flags. OR-ed together and passed as second argument to
- * readTuples.
+ * readTuples. Note that SF_MultiRange has to be set if several
+ * ranges (bounds) are to be passed.
*/
enum ScanFlag {
SF_TupScan = (1 << 16), // scan TUP
SF_OrderBy = (1 << 24), // index scan in order
SF_Descending = (2 << 24), // index scan in descending order
SF_ReadRangeNo = (4 << 24), // enable @ref get_range_no
+ SF_MultiRange = (8 << 24), // scan is part of multi-range scan
SF_KeyInfo = 1 // request KeyInfo to be sent back
};
@@ -70,7 +72,8 @@ public:
*/
#ifdef ndb_readtuples_impossible_overload
int readTuples(LockMode lock_mode = LM_Read,
- Uint32 batch = 0, Uint32 parallel = 0, bool keyinfo = false);
+ Uint32 batch = 0, Uint32 parallel = 0,
+ bool keyinfo = false, bool multi_range = false);
#endif
inline int readTuples(int parallell){
@@ -262,6 +265,7 @@ protected:
bool m_descending;
Uint32 m_read_range_no;
NdbRecAttr *m_curr_row; // Pointer to last returned row
+ bool m_multi_range; // Mark if operation is part of multi-range scan
};
inline
--- 1.81/ndb/src/ndbapi/NdbScanOperation.cpp 2006-12-23 20:04:18 +01:00
+++ 1.82/ndb/src/ndbapi/NdbScanOperation.cpp 2007-02-12 10:05:53 +01:00
@@ -1188,7 +1188,7 @@ NdbIndexScanOperation::setBound(const Nd
* so it's safe to use [tIndexAttrId]
* (instead of looping as is NdbOperation::equal_impl)
*/
- if(type == BoundEQ && tDistrKey)
+ if(type == BoundEQ && tDistrKey && !m_multi_range)
{
theNoOfTupKeyLeft--;
return handle_distribution_key((Uint64*)aValue, sizeInWords);
@@ -1249,7 +1249,8 @@ NdbIndexScanOperation::readTuples(LockMo
const bool order_by = scan_flags & SF_OrderBy;
const bool order_desc = scan_flags & SF_Descending;
const bool read_range_no = scan_flags & SF_ReadRangeNo;
-
+ m_multi_range = scan_flags & SF_MultiRange;
+
int res = NdbScanOperation::readTuples(lm, scan_flags, parallel, batch);
if(!res && read_range_no)
{
@@ -1716,6 +1717,12 @@ NdbIndexScanOperation::reset_bounds(bool
int
NdbIndexScanOperation::end_of_bound(Uint32 no)
{
+ DBUG_ENTER("end_of_bound");
+ DBUG_PRINT("info", ("Range number %u", no));
+ /* Check that SF_MultiRange has been specified if more
+ than one range is specified */
+ if (no > 0 && !m_multi_range)
+ DBUG_RETURN(-1);
if(no < (1 << 13)) // Only 12-bits no of ranges
{
Uint32 bound_head = * m_first_bound_word;
@@ -1724,9 +1731,9 @@ NdbIndexScanOperation::end_of_bound(Uint
m_first_bound_word = theKEYINFOptr + theTotalNrOfKeyWordInSignal;;
m_this_bound_start = theTupKeyLen;
- return 0;
+ DBUG_RETURN(0);
}
- return -1;
+ DBUG_RETURN(-1);
}
int
--- 1.298/sql/ha_ndbcluster.cc 2007-01-24 09:24:48 +01:00
+++ 1.299/sql/ha_ndbcluster.cc 2007-02-12 10:05:53 +01:00
@@ -1995,8 +1995,7 @@ int ha_ndbcluster::set_bounds(NdbIndexSc
DBUG_PRINT("error", ("key %d unknown flag %d", j, p.key->flag));
DBUG_ASSERT(FALSE);
// Stop setting bounds but continue with what we have
- op->end_of_bound(range_no);
- DBUG_RETURN(0);
+ DBUG_RETURN(op->end_of_bound(range_no));
}
}
}
@@ -2043,8 +2042,7 @@ int ha_ndbcluster::set_bounds(NdbIndexSc
tot_len+= part_store_len;
}
- op->end_of_bound(range_no);
- DBUG_RETURN(0);
+ DBUG_RETURN(op->end_of_bound(range_no));
}
/*
@@ -3882,11 +3880,10 @@ int ha_ndbcluster::start_stmt(THD *thd,
ERR_RETURN(ndb->getNdbError());
no_uncommitted_rows_reset(thd);
thd_ndb->stmt= trans;
+ thd_ndb->query_state&= NDB_QUERY_NORMAL;
trans_register_ha(thd, FALSE, &ndbcluster_hton);
}
- thd_ndb->query_state&= NDB_QUERY_NORMAL;
m_active_trans= trans;
-
// Start of statement
m_retrieve_all_fields= FALSE;
m_retrieve_primary_key= FALSE;
@@ -6365,7 +6362,7 @@ ha_ndbcluster::read_multi_range_first(KE
}
else if ((scanOp= m_active_trans->getNdbIndexScanOperation(idx, tab))
&&!scanOp->readTuples(lm, 0, parallelism, sorted,
- FALSE, TRUE, need_pk)
+ FALSE, TRUE, need_pk, TRUE)
&&!generate_scan_filter(m_cond_stack, scanOp)
&&!define_read_attrs(end_of_buffer-reclength, scanOp))
{
@@ -6528,7 +6525,11 @@ close_scan:
}
if (multi_range_curr == multi_range_end)
+ {
+ Thd_ndb *thd_ndb= get_thd_ndb(current_thd);
+ thd_ndb->query_state&= NDB_QUERY_NORMAL;
DBUG_RETURN(HA_ERR_END_OF_FILE);
+ }
/**
* Read remaining ranges
| Thread |
|---|
| • bk commit into 5.0 tree (df:1.2401) | Daniel Fischer | 12 Feb |