~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/item_strfunc.cc

  • Committer: Stewart Smith
  • Date: 2008-07-13 08:00:16 UTC
  • mto: (210.1.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 211.
  • Revision ID: stewart@flamingspork.com-20080713080016-8qtjv9ypt42azzr6
CRC32() as UDF

Show diffs side-by-side

added added

removed removed

Lines of Context:
2656
2656
  return uint4korr(res->ptr()) & 0x3FFFFFFF;
2657
2657
}
2658
2658
 
2659
 
longlong Item_func_crc32::val_int()
2660
 
{
2661
 
  assert(fixed == 1);
2662
 
  String *res=args[0]->val_str(&value);
2663
 
  if (!res)
2664
 
  {
2665
 
    null_value=1;
2666
 
    return 0; /* purecov: inspected */
2667
 
  }
2668
 
  null_value=0;
2669
 
  return (longlong) crc32(0L, (uchar*)res->ptr(), res->length());
2670
 
}
2671
 
 
2672
2659
#ifdef HAVE_COMPRESS
2673
2660
#include "zlib.h"
2674
2661