summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2014-05-30 15:24:25 +0400
committerAlexander Barkov <bar@mariadb.org>2014-05-30 15:24:25 +0400
commit1449d1d54fc4ea876e54bded79c29b51eb6be91d (patch)
treee97bb47ae32df64ab5efc6764a561a9bcf6aab14 /sql/item_strfunc.cc
parent69742e4ee3e019c20dc2432d69e92fd6b76d2193 (diff)
downloadmariadb-git-1449d1d54fc4ea876e54bded79c29b51eb6be91d.tar.gz
Moving implementation of INET_ATON() INET_NTOA() into
separate files item_inetfunc.h and item_inetfunc.cc.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc42
1 files changed, 0 insertions, 42 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 100d54133dd..2c7fc455d41 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -3861,48 +3861,6 @@ void Item_func_export_set::fix_length_and_dec()
fix_char_length(length * 64 + sep_length * 63);
}
-String* Item_func_inet_ntoa::val_str(String* str)
-{
- DBUG_ASSERT(fixed == 1);
- uchar buf[8], *p;
- ulonglong n = (ulonglong) args[0]->val_int();
- char num[4];
-
- /*
- We do not know if args[0] is NULL until we have called
- some val function on it if args[0] is not a constant!
-
- Also return null if n > 255.255.255.255
- */
- if ((null_value= (args[0]->null_value || n > 0xffffffff)))
- return 0; // Null value
-
- str->set_charset(collation.collation);
- str->length(0);
- int4store(buf,n);
-
- /* Now we can assume little endian. */
-
- num[3]='.';
- for (p=buf+4 ; p-- > buf ; )
- {
- uint c = *p;
- uint n1,n2; // Try to avoid divisions
- n1= c / 100; // 100 digits
- c-= n1*100;
- n2= c / 10; // 10 digits
- c-=n2*10; // last digit
- num[0]=(char) n1+'0';
- num[1]=(char) n2+'0';
- num[2]=(char) c+'0';
- uint length= (n1 ? 4 : n2 ? 3 : 2); // Remove pre-zero
- uint dot_length= (p <= buf) ? 1 : 0;
- (void) str->append(num + 4 - length, length - dot_length,
- &my_charset_latin1);
- }
- return str;
-}
-
#define get_esc_bit(mask, num) (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7))