List:Commits« Previous MessageNext Message »
From:stewart Date:July 16 2007 7:35am
Subject:[NDB patch 3/5] BUG#28804 fix ha_ndbcluster::unique_index_read to properly return error
View as plain text  
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
Thread
[NDB patch 0/5] Bug28804 Unknown error returned on a query using joinsstewart16 Jul
  • [NDB patch 3/5] BUG#28804 fix ha_ndbcluster::unique_index_read to properly return errorstewart16 Jul
  • [NDB patch 4/5] BUG#28804 release index operation for unique index lookup (without matching tuple) on completion of operation, not txnstewart16 Jul
  • [NDB patch 5/5] BUG#28804 Dbtc::releaseAbortResources() send returnsignal when exists.stewart16 Jul
    • Re: [NDB patch 5/5] BUG#28804 Dbtc::releaseAbortResources() sendreturnsignal when exists.Jonas Oreland16 Jul
  • [NDB patch 1/5] Test for Bug#28804stewart16 Jul
    • Re: [NDB patch 1/5] Test for Bug#28804Jonas Oreland16 Jul
  • [NDB patch 2/5] BUG#28804 improve NDBAPI behaviour in execute on timeout waiting for txn respones.stewart16 Jul
  • Re: [NDB patch 0/5] Bug28804 Unknown error returned on a queryusing joinsStewart Smith16 Jul
  • Re: [NDB patch 0/5] Bug28804 Unknown error returned on a query usingjoinsJonas Oreland16 Jul