Hi

Let's look at this:

# select SubString_Index("10.0.0.0/24","/",1);
10.0.0.0  
# select ewu_aton("10.0.0.0");
167772160
# select ewu_aton( SubString_Index("10.0.0.0/24","/",1) );
280239936

Why this? My self written ewu_aton seems to work korrectly when calling
it with any normal argument. The ewu_aton code is (as I don't suspect any
bugs in 3.23.31 :-)):

long long ewu_aton(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error) {
  struct in_addr        in;
 
  inet_aton(((char*) args->args[0]), &in);
  *is_null=0;

  return htonl(in.s_addr);
}

TIA and bye,

    -christian-

-- 
              Save the forests, eat more beavers!

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to