~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/blob.cc

  • Committer: Brian Aker
  • Date: 2009-07-11 05:59:19 UTC
  • mfrom: (1089.1.9 merge)
  • Revision ID: brian@gaz-20090711055919-m4px3crrdgta5lie
Collection of patches from new-cleanup (includes asserts for field in debug)

Show diffs side-by-side

added added

removed removed

Lines of Context:
200
200
  char buff[STRING_BUFFER_USUAL_SIZE];
201
201
  String tmpstr(buff,sizeof(buff), &my_charset_bin);
202
202
 
 
203
  ASSERT_COLUMN_MARKED_FOR_WRITE;
 
204
 
203
205
  if (!length)
204
206
  {
205
207
    memset(ptr, 0, Field_blob::pack_length());
268
270
int Field_blob::store(double nr)
269
271
{
270
272
  const CHARSET_INFO * const cs=charset();
 
273
  ASSERT_COLUMN_MARKED_FOR_WRITE;
271
274
  value.set_real(nr, NOT_FIXED_DEC, cs);
272
275
  return Field_blob::store(value.ptr(),(uint32_t) value.length(), cs);
273
276
}
276
279
int Field_blob::store(int64_t nr, bool unsigned_val)
277
280
{
278
281
  const CHARSET_INFO * const cs=charset();
 
282
  ASSERT_COLUMN_MARKED_FOR_WRITE;
279
283
  value.set_int(nr, unsigned_val, cs);
280
284
  return Field_blob::store(value.ptr(), (uint32_t) value.length(), cs);
281
285
}
288
292
  uint32_t length;
289
293
  const CHARSET_INFO *cs;
290
294
 
 
295
  ASSERT_COLUMN_MARKED_FOR_READ;
 
296
 
291
297
  memcpy(&blob,ptr+packlength,sizeof(char*));
292
298
  if (!blob)
293
299
    return 0.0;
301
307
{
302
308
  int not_used;
303
309
  char *blob;
 
310
 
 
311
  ASSERT_COLUMN_MARKED_FOR_READ;
 
312
 
304
313
  memcpy(&blob,ptr+packlength,sizeof(char*));
305
314
  if (!blob)
306
315
    return 0;
312
321
                            String *val_ptr)
313
322
{
314
323
  char *blob;
 
324
 
 
325
  ASSERT_COLUMN_MARKED_FOR_READ;
 
326
 
315
327
  memcpy(&blob,ptr+packlength,sizeof(char*));
316
328
  if (!blob)
317
329
    val_ptr->set("",0,charset());       // A bit safer than ->length(0)
325
337
{
326
338
  const char *blob;
327
339
  size_t length;
 
340
 
 
341
  ASSERT_COLUMN_MARKED_FOR_READ;
 
342
 
328
343
  memcpy(&blob, ptr+packlength, sizeof(const unsigned char*));
329
344
  if (!blob)
330
345
  {