diff options
author | unknown <mskold@mysql.com> | 2005-07-05 10:01:27 +0200 |
---|---|---|
committer | unknown <mskold@mysql.com> | 2005-07-05 10:01:27 +0200 |
commit | 78cfd95ee86397f06f485b320c21b1853b618697 (patch) | |
tree | 96f3bd7c1a44b2853e482fc250f35f9a2f34554d /sql | |
parent | c6c905f773d83b73f7e9ded2a2251fd3f7f04363 (diff) | |
parent | cc55b8c612b46c2a3ab082ea631460ddc79def98 (diff) | |
download | mariadb-git-78cfd95ee86397f06f485b320c21b1853b618697.tar.gz |
Merge mysql.com:/usr/local/home/marty/MySQL/mysql-4.1
into mysql.com:/usr/local/home/marty/MySQL/mysql-5.0
sql/ha_ndbcluster.h:
Auto merged
sql/ha_ndbcluster.cc:
Merge
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_ndbcluster.cc | 44 | ||||
-rw-r--r-- | sql/ha_ndbcluster.h | 5 |
2 files changed, 12 insertions, 37 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index def99b51f95..d26c92401dc 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1249,12 +1249,12 @@ int ha_ndbcluster::set_primary_key(NdbOperation *op, const byte *key) } -int ha_ndbcluster::set_primary_key_from_old_data(NdbOperation *op, const byte *old_data) +int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const byte *old_data) { KEY* key_info= table->key_info + table->s->primary_key; KEY_PART_INFO* key_part= key_info->key_part; KEY_PART_INFO* end= key_part+key_info->key_parts; - DBUG_ENTER("set_primary_key_from_old_data"); + DBUG_ENTER("set_primary_key_from_record"); for (; key_part != end; key_part++) { @@ -1266,24 +1266,6 @@ int ha_ndbcluster::set_primary_key_from_old_data(NdbOperation *op, const byte *o DBUG_RETURN(0); } - -int ha_ndbcluster::set_primary_key(NdbOperation *op) -{ - DBUG_ENTER("set_primary_key"); - KEY* key_info= table->key_info + table->s->primary_key; - KEY_PART_INFO* key_part= key_info->key_part; - KEY_PART_INFO* end= key_part+key_info->key_parts; - - for (; key_part != end; key_part++) - { - Field* field= key_part->field; - if (set_ndb_key(op, field, - key_part->fieldnr-1, field->ptr)) - ERR_RETURN(op->getNdbError()); - } - DBUG_RETURN(0); -} - int ha_ndbcluster::set_index_key(NdbOperation *op, const KEY *key_info, @@ -1423,11 +1405,9 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data) if (!(op= trans->getNdbOperation((const NDBTAB *) m_table)) || op->readTuple(lm) != 0) ERR_RETURN(trans->getNdbError()); - int res; - if ((res= set_primary_key_from_old_data(op, old_data))) + if ((res= set_primary_key_from_record(op, old_data))) ERR_RETURN(trans->getNdbError()); - // Read all unreferenced non-key field(s) for (i= 0; i < no_fields; i++) { @@ -1470,7 +1450,7 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data) Peek to check if a particular row already exists */ -int ha_ndbcluster::peek_row() +int ha_ndbcluster::peek_row(const byte *record) { NdbTransaction *trans= m_active_trans; NdbOperation *op; @@ -1483,7 +1463,7 @@ int ha_ndbcluster::peek_row() ERR_RETURN(trans->getNdbError()); int res; - if ((res= set_primary_key(op))) + if ((res= set_primary_key_from_record(op, record))) ERR_RETURN(trans->getNdbError()); if (execute_no_commit_ie(this,trans) != 0) @@ -1928,7 +1908,7 @@ int ha_ndbcluster::write_row(byte *record) if (m_ignore_dup_key && table->s->primary_key != MAX_KEY) { - int peek_res= peek_row(); + int peek_res= peek_row(record); if (!peek_res) { @@ -1982,9 +1962,7 @@ int ha_ndbcluster::write_row(byte *record) m_skip_auto_increment= !auto_increment_column_changed; } - if ((res= (m_primary_key_update ? - set_primary_key_from_old_data(op, record) - : set_primary_key(op)))) + if ((res= set_primary_key_from_record(op, record))) return res; } @@ -2204,7 +2182,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) else { int res; - if ((res= set_primary_key_from_old_data(op, old_data))) + if ((res= set_primary_key_from_record(op, old_data))) DBUG_RETURN(res); } } @@ -2289,10 +2267,8 @@ int ha_ndbcluster::delete_row(const byte *record) else { int res; - if ((res= (m_primary_key_update ? - set_primary_key_from_old_data(op, record) - : set_primary_key(op)))) - return res; + if ((res= set_primary_key_from_record(op, record))) + return res; } } diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index d20fafa458f..b75853dd5d0 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -551,7 +551,7 @@ private: int pk_read(const byte *key, uint key_len, byte *buf); int complemented_pk_read(const byte *old_data, byte *new_data); - int peek_row(); + int peek_row(const byte *record); int unique_index_read(const byte *key, uint key_len, byte *buf); int ordered_index_scan(const key_range *start_key, @@ -580,8 +580,7 @@ private: friend int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg); int get_ndb_blobs_value(NdbBlob *last_ndb_blob); int set_primary_key(NdbOperation *op, const byte *key); - int set_primary_key(NdbOperation *op); - int set_primary_key_from_old_data(NdbOperation *op, const byte *old_data); + int set_primary_key_from_record(NdbOperation *op, const byte *old_data); int set_bounds(NdbIndexScanOperation*, const key_range *keys[2], uint= 0); int key_cmp(uint keynr, const byte * old_row, const byte * new_row); int set_index_key(NdbOperation *, const KEY *key_info, const byte *key_ptr); |