~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_proto_write.cc

  • Committer: Brian Aker
  • Date: 2009-08-18 07:20:29 UTC
  • mfrom: (1117.1.9 merge)
  • Revision ID: brian@gaz-20090818072029-s9ch5lcmltxwidn7
Merge of Brian

Show diffs side-by-side

added added

removed removed

Lines of Context:
274
274
 
275
275
  }
276
276
 
277
 
  if (create_info->used_fields & HA_CREATE_USED_PACK_KEYS)
278
 
  {
279
 
    if(create_info->table_options & HA_OPTION_PACK_KEYS)
280
 
      table_options->set_pack_keys(true);
281
 
    else if(create_info->table_options & HA_OPTION_NO_PACK_KEYS)
282
 
      table_options->set_pack_keys(false);
283
 
  }
284
 
  else
285
 
    if(create_info->table_options & HA_OPTION_PACK_KEYS)
286
 
      table_options->set_pack_keys(true);
287
 
 
288
 
 
289
 
  if (create_info->used_fields & HA_CREATE_USED_CHECKSUM)
290
 
  {
291
 
    assert(create_info->table_options & (HA_OPTION_CHECKSUM | HA_OPTION_NO_CHECKSUM));
292
 
 
293
 
    if(create_info->table_options & HA_OPTION_CHECKSUM)
294
 
      table_options->set_checksum(true);
295
 
    else
296
 
      table_options->set_checksum(false);
297
 
  }
298
 
  else if(create_info->table_options & HA_OPTION_CHECKSUM)
299
 
    table_options->set_checksum(true);
300
 
 
301
 
 
302
 
  if (create_info->used_fields & HA_CREATE_USED_PAGE_CHECKSUM)
303
 
  {
304
 
    if (create_info->page_checksum == HA_CHOICE_YES)
305
 
      table_options->set_page_checksum(true);
306
 
    else if (create_info->page_checksum == HA_CHOICE_NO)
307
 
      table_options->set_page_checksum(false);
308
 
  }
309
 
  else if (create_info->page_checksum == HA_CHOICE_YES)
310
 
    table_options->set_page_checksum(true);
311
 
 
312
 
 
313
 
  if (create_info->used_fields & HA_CREATE_USED_DELAY_KEY_WRITE)
314
 
  {
315
 
    if(create_info->table_options & HA_OPTION_DELAY_KEY_WRITE)
316
 
      table_options->set_delay_key_write(true);
317
 
    else if(create_info->table_options & HA_OPTION_NO_DELAY_KEY_WRITE)
318
 
      table_options->set_delay_key_write(false);
319
 
  }
320
 
  else if(create_info->table_options & HA_OPTION_DELAY_KEY_WRITE)
321
 
    table_options->set_delay_key_write(true);
322
 
 
323
 
 
324
277
  switch(create_info->row_type)
325
278
  {
326
279
  case ROW_TYPE_DEFAULT:
351
304
  table_options->set_pack_record(create_info->table_options
352
305
                                 & HA_OPTION_PACK_RECORD);
353
306
 
354
 
  if (create_info->comment.length)
 
307
  if (table_options->has_comment())
355
308
  {
356
309
    uint32_t tmp_len;
357
310
    tmp_len= system_charset_info->cset->charpos(system_charset_info,
358
 
                                                create_info->comment.str,
359
 
                                                create_info->comment.str +
360
 
                                                create_info->comment.length,
361
 
                                                TABLE_COMMENT_MAXLEN);
 
311
                                                table_options->comment().c_str(),
 
312
                                                table_options->comment().c_str() +
 
313
                                                table_options->comment().length(),
 
314
                                                TABLE_COMMENT_MAXLEN);
362
315
 
363
 
    if (tmp_len < create_info->comment.length)
 
316
    if (tmp_len < table_options->comment().length())
364
317
    {
365
318
      my_error(ER_WRONG_STRING_LENGTH, MYF(0),
366
 
               create_info->comment.str,"Table COMMENT",
367
 
               (uint32_t) TABLE_COMMENT_MAXLEN);
 
319
               table_options->comment().c_str(),"Table COMMENT",
 
320
               (uint32_t) TABLE_COMMENT_MAXLEN);
368
321
      return(1);
369
322
    }
 
323
  }
370
324
 
371
 
    table_options->set_comment(create_info->comment.str);
372
 
  }
373
325
  if (create_info->default_table_charset)
374
326
  {
375
327
    table_options->set_collation_id(
386
338
  if (create_info->index_file_name)
387
339
    table_options->set_index_file_name(create_info->index_file_name);
388
340
 
389
 
  if (create_info->max_rows)
390
 
    table_options->set_max_rows(create_info->max_rows);
391
 
 
392
 
  if (create_info->min_rows)
393
 
    table_options->set_min_rows(create_info->min_rows);
394
 
 
395
341
  if (create_info->auto_increment_value)
396
342
    table_options->set_auto_increment_value(create_info->auto_increment_value);
397
343
 
398
 
  if (create_info->avg_row_length)
399
 
    table_options->set_avg_row_length(create_info->avg_row_length);
400
 
 
401
344
  if (create_info->key_block_size)
402
345
    table_options->set_key_block_size(create_info->key_block_size);
403
346