List:Commits« Previous MessageNext Message »
From:Georgi Kodinov Date:February 11 2010 5:42pm
Subject:bzr commit into mysql-5.1-bugteam branch (joro:3376) Bug#46175
View as plain text  
#At file:///home/kgeorge/mysql/work/B46175-5.1-bugteam/ based on revid:martin.hansson@stripped

 3376 Georgi Kodinov	2010-02-11
      Addendum to bug #46175 : use and check for the correct error values
        when converting to a enumerated type.

    modified:
      sql/item.cc
      sql/sql_select.h
=== modified file 'sql/item.cc'
--- a/sql/item.cc	2010-02-06 19:54:30 +0000
+++ b/sql/item.cc	2010-02-11 17:41:53 +0000
@@ -5157,7 +5157,7 @@ int Item::save_in_field(Field *field, bo
     field->set_notnull();
     error=field->store(nr, unsigned_flag);
   }
-  return error ? error : (field->table->in_use->is_error() ? 2 : 0);
+  return error ? error : (field->table->in_use->is_error() ? 1 : 0);
 }
 
 

=== modified file 'sql/sql_select.h'
--- a/sql/sql_select.h	2010-02-10 14:56:47 +0000
+++ b/sql/sql_select.h	2010-02-11 17:41:53 +0000
@@ -736,10 +736,11 @@ public:
      we need to check for errors executing it and react accordingly
     */
     if (!res && table->in_use->is_error())
-      res= 2;
+      res= 1; /* STORE_KEY_FATAL */
     dbug_tmp_restore_column_map(table->write_set, old_map);
     null_key= to_field->is_null() || item->null_value;
-    return (err != 0 || res > 2 ? STORE_KEY_FATAL : (store_key_result) res); 
+    return ((err != 0 || res < 0 || res > 2) ? STORE_KEY_FATAL : 
+            (store_key_result) res);
   }
 };
 
@@ -775,10 +776,10 @@ protected:  
         we need to check for errors executing it and react accordingly
         */
       if (!err && to_field->table->in_use->is_error())
-        err= 2;
+        err= 1; /* STORE_KEY_FATAL */
     }
     null_key= to_field->is_null() || item->null_value;
-    return (err > 2 ?  STORE_KEY_FATAL : (store_key_result) err);
+    return ((err < 0 || err > 2) ? STORE_KEY_FATAL : (store_key_result) err);
   }
 };
 


Attachment: [text/bzr-bundle] bzr/joro@sun.com-20100211174153-ugrdxijnc89jt29s.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (joro:3376) Bug#46175Georgi Kodinov11 Feb