summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2005-06-15 08:39:00 -0700
committerigor@rurik.mysql.com <>2005-06-15 08:39:00 -0700
commitff0b7e4d73925572af8b33513aec2153b185091c (patch)
tree73f29489128453f0db18442788c45626544ff71f /sql/field.cc
parent38aa20d380065d8d36cf81d334702c3d1277a78f (diff)
parent316815f44e37812ab694229917e898acca1471a7 (diff)
downloadmariadb-git-ff0b7e4d73925572af8b33513aec2153b185091c.tar.gz
Manual merge
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc37
1 files changed, 29 insertions, 8 deletions
diff --git a/sql/field.cc b/sql/field.cc
index acf3c0647cb..6e63dad41bb 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -5956,14 +5956,6 @@ longlong Field_string::val_int(void)
}
-my_decimal *Field_longstr::val_decimal(my_decimal *decimal_value)
-{
- str2my_decimal(E_DEC_FATAL_ERROR, ptr, field_length, charset(),
- decimal_value);
- return decimal_value;
-}
-
-
String *Field_string::val_str(String *val_buffer __attribute__((unused)),
String *val_ptr)
{
@@ -5975,6 +5967,14 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)),
}
+my_decimal *Field_string::val_decimal(my_decimal *decimal_value)
+{
+ str2my_decimal(E_DEC_FATAL_ERROR, ptr, field_length, charset(),
+ decimal_value);
+ return decimal_value;
+}
+
+
int Field_string::cmp(const char *a_ptr, const char *b_ptr)
{
uint a_len, b_len;
@@ -6288,6 +6288,15 @@ String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
}
+my_decimal *Field_varstring::val_decimal(my_decimal *decimal_value)
+{
+ uint length= length_bytes == 1 ? (uint) (uchar) *ptr : uint2korr(ptr);
+ str2my_decimal(E_DEC_FATAL_ERROR, ptr+length_bytes, length, charset(),
+ decimal_value);
+ return decimal_value;
+}
+
+
int Field_varstring::cmp(const char *a_ptr, const char *b_ptr)
{
uint a_length, b_length;
@@ -6906,6 +6915,18 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
}
+my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
+{
+ char *blob;
+ memcpy_fixed(&blob, ptr+packlength, sizeof(char*));
+ if (!blob)
+ blob= "";
+ str2my_decimal(E_DEC_FATAL_ERROR, blob, get_length(ptr), charset(),
+ decimal_value);
+ return decimal_value;
+}
+
+
int Field_blob::cmp(const char *a,uint32 a_length, const char *b,
uint32 b_length)
{