[NDB patch 3/5] BUG#28804 fix ha_ndbcluster::unique_index_read to properly return error
On error during unique index read, set table->status appropriately.
This ensures the user gets the correct error from NDB.
The okay error is still, of course, STATUS_NOT_FOUND
TAKE2:
- use HA_ERR_KEY_NOT_FOUND instead of magic 120
- sql/ha_ndbcluster.cc 1.313 vs edited =====
Index: ndb-work/sql/ha_ndbcluster.cc
- ndb-work.orig/sql/ha_ndbcluster.cc 2007-07-02 16:01:29.970054148 +1000
+++ ndb-work/sql/ha_ndbcluster.cc 2007-07-02 16:06:54.052522555 +1000
@@ -1758,9 +1758,15 @@ int ha_ndbcluster::unique_index_read(con
if (execute_no_commit_ie(this,trans,false) != 0)
{
- table->status= STATUS_NOT_FOUND;
- DBUG_RETURN(ndb_err(trans));
+ int err= ndb_err(trans);
+ if(err==HA_ERR_KEY_NOT_FOUND)
+ table->status= STATUS_NOT_FOUND;
+ else
+ table->status= STATUS_GARBAGE;
+
+ DBUG_RETURN(err);
}
+
// The value have now been fetched from NDB
unpack_record(buf);
table->status= 0;
--
Stewart Smith
--
MySQL Code Commits Mailing List
For list archives:
http://lists.mysql.com/commits
To unsubscribe:
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Mon Jul 16 01:39:04 2007
This archive was generated by hypermail 2.1.8
: Thu Aug 02 2007 - 01:56:40 EDT
|