summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <tulin@build.mysql.com>2004-09-09 10:41:33 +0200
committerunknown <tulin@build.mysql.com>2004-09-09 10:41:33 +0200
commit9106686846cb87de91afe5068b29caa72e2e537b (patch)
tree08926077476c0cd8f62d6215c6a9dc9c61d8f1bf /sql/ha_ndbcluster.cc
parentc59228f85c881f31e3fa017d15a7c7fba8ab708a (diff)
parent1460e454d066c928de8f95870c72a2515d8bbc79 (diff)
downloadmariadb-git-9106686846cb87de91afe5068b29caa72e2e537b.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into build.mysql.com:/users/tulin/mysql-4.1-ndb-merge sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_table.cc: Auto merged
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc47
1 files changed, 44 insertions, 3 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
index 08c82e12b29..d35f84a8fc8 100644
--- a/sql/ha_ndbcluster.cc
+++ b/sql/ha_ndbcluster.cc
@@ -1132,12 +1132,12 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op,
const char* bounds[]= {"LE", "LT", "GE", "GT", "EQ"};
DBUG_ASSERT(bound >= 0 && bound <= 4);
- DBUG_PRINT("info", ("Set Bound%s on %s %s %s %s",
+ DBUG_PRINT("info", ("Set Bound%s on %s %s %s",
bounds[bound],
field->field_name,
key_nullable ? "NULLABLE" : "",
key_null ? "NULL":""));
- DBUG_PRINT("info", ("Total length %ds", tot_len));
+ DBUG_PRINT("info", ("Total length %d", tot_len));
DBUG_DUMP("key", (char*) key_ptr, key_store_len);
@@ -1164,6 +1164,44 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op,
DBUG_RETURN(0);
}
+#ifndef DBUG_OFF
+
+const char* key_flag_strs[] =
+{ "HA_READ_KEY_EXACT",
+ "HA_READ_KEY_OR_NEXT",
+ "HA_READ_KEY_OR_PREV",
+ "HA_READ_AFTER_KEY",
+ "HA_READ_BEFORE_KEY",
+ "HA_READ_PREFIX",
+ "HA_READ_PREFIX_LAST",
+ "HA_READ_PREFIX_LAST_OR_PREV",
+ "HA_READ_MBR_CONTAIN",
+ "HA_READ_MBR_INTERSECT",
+ "HA_READ_MBR_WITHIN",
+ "HA_READ_MBR_DISJOINT",
+ "HA_READ_MBR_EQUAL"
+};
+
+const int no_of_key_flags = sizeof(key_flag_strs)/sizeof(char*);
+
+void print_key(const key_range* key, const char* info)
+{
+ if (key)
+ {
+ const char* str= key->flag < no_of_key_flags ?
+ key_flag_strs[key->flag] : "Unknown flag";
+
+ DBUG_LOCK_FILE;
+ fprintf(DBUG_FILE,"%s: %s, length=%d, key=", info, str, key->length);
+ uint i;
+ for (i=0; i<key->length-1; i++)
+ fprintf(DBUG_FILE,"%0d ", key->key[i]);
+ fprintf(DBUG_FILE, "\n");
+ DBUG_UNLOCK_FILE;
+ }
+ return;
+}
+#endif
/*
Start ordered index scan in NDB
@@ -1181,6 +1219,9 @@ int ha_ndbcluster::ordered_index_scan(const key_range *start_key,
DBUG_ENTER("ordered_index_scan");
DBUG_PRINT("enter", ("index: %u, sorted: %d", active_index, sorted));
DBUG_PRINT("enter", ("Starting new ordered scan on %s", m_tabname));
+
+ DBUG_EXECUTE("enter", print_key(start_key, "start_key"););
+ DBUG_EXECUTE("enter", print_key(end_key, "end_key"););
index_name= get_index_name(active_index);
if (!(op= trans->getNdbIndexScanOperation((NDBINDEX *)
@@ -2406,7 +2447,7 @@ int ha_ndbcluster::end_bulk_insert()
rows_inserted, bulk_insert_rows));
bulk_insert_not_flushed= false;
if (trans->execute(NoCommit) != 0)
- error= ndb_err(trans);
+ my_errno= error= ndb_err(trans);
}
rows_inserted= 0;