summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2010-02-11 19:41:53 +0200
committerGeorgi Kodinov <joro@sun.com>2010-02-11 19:41:53 +0200
commit32902dad006b68e2bdb855f9c2ea1910a9195c9c (patch)
tree0ecde18d6ef311d09aac32edb48e35ecd8c8a815 /sql/sql_select.h
parent80164ae9a08041e67c65460d9bb2a6b0e1aeb277 (diff)
downloadmariadb-git-32902dad006b68e2bdb855f9c2ea1910a9195c9c.tar.gz
Addendum to bug #46175 : use and check for the correct error values
when converting to a enumerated type.
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r--sql/sql_select.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h
index ef43f9b049c..8d3520bf9c8 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -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);
}
};