summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2005-01-19 07:37:42 +0100
committerunknown <joreland@mysql.com>2005-01-19 07:37:42 +0100
commit7cbe4d19e4f152fcb5c7b0e2cb3da116132b8aef (patch)
treef254fa19624bbd4b2781b2a8bf2cf8433c04a84e /sql/ha_ndbcluster.cc
parent0eb1a8107f2b245b6bbcdc78d0a49a78996df3c9 (diff)
parentbfe74e69903583f1bb9b4ad803c137d6487afa74 (diff)
downloadmariadb-git-7cbe4d19e4f152fcb5c7b0e2cb3da116132b8aef.tar.gz
Merge mysql.com:/home/jonas/src/mysql-5.0
into mysql.com:/home/jonas/src/mysql-5.0-ndb ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/mysqld.cc: Auto merged
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc94
1 files changed, 47 insertions, 47 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 5f07a7893d5..e26622422cd 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -656,7 +656,7 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob)
char *buf= m_blobs_buffer + offset;
uint32 len= 0xffffffff; // Max uint32
DBUG_PRINT("value", ("read blob ptr=%x len=%u",
- (uint)buf, (uint)blob_len));
+ (UintPtr)buf, (uint)blob_len));
if (ndb_blob->readData(buf, len) != 0)
DBUG_RETURN(-1);
DBUG_ASSERT(len == blob_len);
@@ -1152,6 +1152,47 @@ ha_ndbcluster::set_index_key(NdbOperation *op,
DBUG_RETURN(0);
}
+inline
+int ha_ndbcluster::define_read_attrs(byte* buf, NdbOperation* op)
+{
+ uint i;
+ THD *thd= current_thd;
+
+ DBUG_ENTER("define_read_attrs");
+
+ // Define attributes to read
+ for (i= 0; i < table->s->fields; i++)
+ {
+ Field *field= table->field[i];
+ if ((thd->query_id == field->query_id) ||
+ ((field->flags & PRI_KEY_FLAG)) ||
+ m_retrieve_all_fields)
+ {
+ if (get_ndb_value(op, field, i, buf))
+ ERR_RETURN(op->getNdbError());
+ }
+ else
+ {
+ m_value[i].ptr= NULL;
+ }
+ }
+
+ if (table->s->primary_key == MAX_KEY)
+ {
+ DBUG_PRINT("info", ("Getting hidden key"));
+ // Scanning table with no primary key
+ int hidden_no= table->s->fields;
+#ifndef DBUG_OFF
+ const NDBTAB *tab= (const NDBTAB *) m_table;
+ if (!tab->getColumn(hidden_no))
+ DBUG_RETURN(1);
+#endif
+ if (get_ndb_value(op, NULL, hidden_no, NULL))
+ ERR_RETURN(op->getNdbError());
+ }
+ DBUG_RETURN(0);
+}
+
/*
Read one record from NDB using primary key
*/
@@ -1625,47 +1666,6 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op,
DBUG_RETURN(0);
}
-inline
-int ha_ndbcluster::define_read_attrs(byte* buf, NdbOperation* op)
-{
- uint i;
- THD *thd= current_thd;
-
- DBUG_ENTER("define_read_attrs");
-
- // Define attributes to read
- for (i= 0; i < table->s->fields; i++)
- {
- Field *field= table->field[i];
- if ((thd->query_id == field->query_id) ||
- ((field->flags & PRI_KEY_FLAG)) ||
- m_retrieve_all_fields)
- {
- if (get_ndb_value(op, field, i, buf))
- ERR_RETURN(op->getNdbError());
- }
- else
- {
- m_value[i].ptr= NULL;
- }
- }
-
- if (table->s->primary_key == MAX_KEY)
- {
- DBUG_PRINT("info", ("Getting hidden key"));
- // Scanning table with no primary key
- int hidden_no= table->s->fields;
-#ifndef DBUG_OFF
- const NDBTAB *tab= (const NDBTAB *) m_table;
- if (!tab->getColumn(hidden_no))
- DBUG_RETURN(1);
-#endif
- if (get_ndb_value(op, NULL, hidden_no, NULL))
- ERR_RETURN(op->getNdbError());
- }
- DBUG_RETURN(0);
-}
-
/*
Start ordered index scan in NDB
*/
@@ -2527,13 +2527,13 @@ int ha_ndbcluster::index_read_last(byte * buf, const byte * key, uint key_len)
inline
int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key,
const key_range *end_key,
- bool eq_range, bool sorted,
+ bool eq_r, bool sorted,
byte* buf)
{
KEY* key_info;
int error= 1;
DBUG_ENTER("ha_ndbcluster::read_range_first_to_buf");
- DBUG_PRINT("info", ("eq_range: %d, sorted: %d", eq_range, sorted));
+ DBUG_PRINT("info", ("eq_r: %d, sorted: %d", eq_r, sorted));
switch (get_index_type(active_index)){
case PRIMARY_KEY_ORDERED_INDEX:
@@ -2574,14 +2574,14 @@ int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key,
int ha_ndbcluster::read_range_first(const key_range *start_key,
const key_range *end_key,
- bool eq_range, bool sorted)
+ bool eq_r, bool sorted)
{
byte* buf= table->record[0];
DBUG_ENTER("ha_ndbcluster::read_range_first");
DBUG_RETURN(read_range_first_to_buf(start_key,
end_key,
- eq_range,
+ eq_r,
sorted,
buf));
}
@@ -3271,7 +3271,7 @@ int ha_ndbcluster::start_stmt(THD *thd)
#if 0
NdbTransaction *tablock_trans=
(NdbTransaction*)thd->transaction.all.ndb_tid;
- DBUG_PRINT("info", ("tablock_trans: %x", (uint)tablock_trans));
+ DBUG_PRINT("info", ("tablock_trans: %x", (UintPtr)tablock_trans));
DBUG_ASSERT(tablock_trans);
// trans= ndb->hupp(tablock_trans);
#endif