~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Eric Herman
  • Date: 2008-12-06 19:42:46 UTC
  • mto: (656.1.6 devel)
  • mto: This revision was merged to the branch mainline in revision 665.
  • Revision ID: eric@mysql.com-20081206194246-5cdexuu81i366eek
removed trailing whitespace with simple script:

for file in $(find . -name "*.c") $(find . -name "*.cc") $(find . -name "*.h"); do ruby -pe 'gsub(/\s+$/, $/)' < $file > $file.out; mv $file.out $file; done;

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
 
72
72
  DESCRIPTION
73
73
    Checks file name part starting with the rightmost '.' character,
74
 
    and returns it if it is equal to '.frm'. 
 
74
    and returns it if it is equal to '.frm'.
75
75
 
76
76
  TODO
77
77
    It is a good idea to get rid of this function modifying the code
186
186
    session         thread handle
187
187
    share       Share to fill
188
188
    key         Table_cache_key, as generated from create_table_def_key.
189
 
                must start with db name.    
 
189
                must start with db name.
190
190
    key_length  Length of key
191
191
    table_name  Table name
192
192
    path        Path to file (possible in lower case) without .frm
271
271
    pthread_cond_destroy(&share->cond);
272
272
  }
273
273
  hash_free(&share->name_hash);
274
 
  
 
274
 
275
275
  plugin_unlock(NULL, share->db_plugin);
276
276
  share->db_plugin= NULL;
277
277
 
283
283
 
284
284
/*
285
285
  Read table definition from a binary / text based .frm file
286
 
  
 
286
 
287
287
  SYNOPSIS
288
288
  open_table_def()
289
289
  session               Thread handler
327
327
  {
328
328
    /*
329
329
      We don't try to open 5.0 unencoded name, if
330
 
      - non-encoded name contains '@' signs, 
 
330
      - non-encoded name contains '@' signs,
331
331
        because '@' can be misinterpreted.
332
332
        It is not clear if '@' is escape character in 5.1,
333
333
        or a normal character in 5.0.
334
 
        
 
334
 
335
335
      - non-encoded db or table name contain "#mysql50#" prefix.
336
336
        This kind of tables must have been opened only by the
337
337
        open() above.
475
475
    if the storage engine is dynamic, no point in resolving it by its
476
476
    dynamically allocated legacy_db_type. We will resolve it later by name.
477
477
  */
478
 
  if (legacy_db_type > DB_TYPE_UNKNOWN && 
 
478
  if (legacy_db_type > DB_TYPE_UNKNOWN &&
479
479
      legacy_db_type < DB_TYPE_FIRST_DYNAMIC)
480
 
    share->db_plugin= ha_lock_engine(NULL, 
 
480
    share->db_plugin= ha_lock_engine(NULL,
481
481
                                     ha_checktype(session, legacy_db_type, 0, 0));
482
482
  share->db_create_options= db_create_options= uint2korr(head+30);
483
483
  share->db_options_in_use= share->db_create_options;
600
600
      keyinfo->comment.str= strmake_root(&share->mem_root, (char*) strpos+2,
601
601
                                         keyinfo->comment.length);
602
602
      strpos+= 2 + keyinfo->comment.length;
603
 
    } 
604
 
    assert(test(keyinfo->flags & HA_USES_COMMENT) == 
 
603
    }
 
604
    assert(test(keyinfo->flags & HA_USES_COMMENT) ==
605
605
               (keyinfo->comment.length > 0));
606
606
  }
607
607
 
611
611
  record_offset= (ulong) (uint2korr(head+6)+
612
612
                          ((uint2korr(head+14) == 0xffff ?
613
613
                            uint4korr(head+47) : uint2korr(head+14))));
614
 
 
 
614
 
615
615
  if ((n_length= uint4korr(head+55)))
616
616
  {
617
617
    /* Read extra data segment */
784
784
  memcpy(names, strpos+(share->fields*field_pack_length),
785
785
         (uint) (n_length+int_length));
786
786
  comment_pos= names+(n_length+int_length);
787
 
  memcpy(comment_pos, disk_buff+read_length-com_length-vcol_screen_length, 
 
787
  memcpy(comment_pos, disk_buff+read_length-com_length-vcol_screen_length,
788
788
         com_length);
789
789
  vcol_screen_pos= names+(n_length+int_length+com_length);
790
 
  memcpy(vcol_screen_pos, disk_buff+read_length-vcol_screen_length, 
 
790
  memcpy(vcol_screen_pos, disk_buff+read_length-vcol_screen_length,
791
791
         vcol_screen_length);
792
792
 
793
793
  fix_type_pointers(&interval_array, &share->fieldnames, 1, &names);
885
885
      if (field_type == DRIZZLE_TYPE_VIRTUAL)
886
886
      {
887
887
        assert(interval_nr); // Expect non-null expression
888
 
        /* 
 
888
        /*
889
889
          The interval_id byte in the .frm file stores the length of the
890
890
          expression statement for a virtual column.
891
891
        */
945
945
      {
946
946
        /*
947
947
          Try to choose the best 4.1 type:
948
 
          - for 4.0 "CHAR(N) BINARY" or "VARCHAR(N) BINARY" 
 
948
          - for 4.0 "CHAR(N) BINARY" or "VARCHAR(N) BINARY"
949
949
            try to find a binary collation for character set.
950
 
          - for other types (e.g. BLOB) just use my_charset_bin. 
 
950
          - for other types (e.g. BLOB) just use my_charset_bin.
951
951
        */
952
952
        if (!f_is_blob(pack_flag))
953
953
        {
1178
1178
  {
1179
1179
    /* Old file format with default as not null */
1180
1180
    uint32_t null_length= (share->null_fields+7)/8;
1181
 
    memset(share->default_values + (null_flags - (unsigned char*) record), 
 
1181
    memset(share->default_values + (null_flags - (unsigned char*) record),
1182
1182
          null_length, 255);
1183
1183
  }
1184
1184
 
1274
1274
}
1275
1275
 
1276
1276
/*
1277
 
  The function uses the feature in fix_fields where the flag 
 
1277
  The function uses the feature in fix_fields where the flag
1278
1278
  GET_FIXED_FIELDS_FLAG is set for all fields in the item tree.
1279
1279
  This field must always be reset before returning from the function
1280
1280
  since it is used for other purposes as well.
1363
1363
    goto end;
1364
1364
  }
1365
1365
  session->where= save_where;
1366
 
  /* 
1367
 
    Walk through the Item tree checking if all items are valid 
 
1366
  /*
 
1367
    Walk through the Item tree checking if all items are valid
1368
1368
   to be part of the virtual column
1369
1369
 */
1370
1370
  error= func_expr->walk(&Item::check_vcol_func_processor, 0, NULL);
1382
1382
  }
1383
1383
  /* Ensure that this virtual column is not based on another virtual field. */
1384
1384
  ptr= table->field;
1385
 
  while ((field= *(ptr++))) 
 
1385
  while ((field= *(ptr++)))
1386
1386
  {
1387
1387
    if ((field->flags & GET_FIXED_FIELDS_FLAG) &&
1388
1388
        (field->vcol_info))
1432
1432
{
1433
1433
  assert(vcol_expr);
1434
1434
 
1435
 
  /* 
 
1435
  /*
1436
1436
    Step 1: Construct a statement for the parser.
1437
1437
    The parsed string needs to take the following format:
1438
1438
    "PARSE_VCOL_EXPR (<expr_string_from_frm>)"
1439
1439
  */
1440
1440
  char *vcol_expr_str;
1441
1441
  int str_len= 0;
1442
 
  
 
1442
 
1443
1443
  if (!(vcol_expr_str= (char*) alloc_root(&table->mem_root,
1444
 
                                          vcol_expr->length + 
 
1444
                                          vcol_expr->length +
1445
1445
                                            parse_vcol_keyword.length + 3)))
1446
1446
  {
1447
1447
    return(true);
1452
1452
  str_len= parse_vcol_keyword.length;
1453
1453
  memcpy(vcol_expr_str + str_len, "(", 1);
1454
1454
  str_len++;
1455
 
  memcpy(vcol_expr_str + str_len, 
1456
 
         (char*) vcol_expr->str, 
 
1455
  memcpy(vcol_expr_str + str_len,
 
1456
         (char*) vcol_expr->str,
1457
1457
         vcol_expr->length);
1458
1458
  str_len+= vcol_expr->length;
1459
1459
  memcpy(vcol_expr_str + str_len, ")", 1);
1462
1462
  str_len++;
1463
1463
  Lex_input_stream lip(session, vcol_expr_str, str_len);
1464
1464
 
1465
 
  /* 
 
1465
  /*
1466
1466
    Step 2: Setup session for parsing.
1467
1467
    1) make Item objects be created in the memory allocated for the Table
1468
1468
       object (not TABLE_SHARE)
1469
 
    2) ensure that created Item's are not put on to session->free_list 
1470
 
       (which is associated with the parsed statement and hence cleared after 
 
1469
    2) ensure that created Item's are not put on to session->free_list
 
1470
       (which is associated with the parsed statement and hence cleared after
1471
1471
       the parsing)
1472
 
    3) setup a flag in the LEX structure to allow "PARSE_VCOL_EXPR" 
 
1472
    3) setup a flag in the LEX structure to allow "PARSE_VCOL_EXPR"
1473
1473
       to be parsed as a SQL command.
1474
1474
  */
1475
1475
  MEM_ROOT **root_ptr, *old_root;
1480
1480
  session->free_list= NULL;
1481
1481
  session->lex->parse_vcol_expr= true;
1482
1482
 
1483
 
  /* 
 
1483
  /*
1484
1484
    Step 3: Use the parser to build an Item object from.
1485
1485
  */
1486
1486
  if (parse_sql(session, &lip))
1674
1674
      goto err;
1675
1675
    outparam->key_info= key_info;
1676
1676
    key_part= (reinterpret_cast<KEY_PART_INFO*> (key_info+share->keys));
1677
 
    
 
1677
 
1678
1678
    memcpy(key_info, share->key_info, sizeof(*key_info)*share->keys);
1679
1679
    memcpy(key_part, share->key_info[0].key_part, (sizeof(*key_part) *
1680
1680
                                                   share->key_parts));
1718
1718
    goto err;
1719
1719
 
1720
1720
  outparam->vfield= vfield_ptr;
1721
 
  
 
1721
 
1722
1722
  for (field_ptr= outparam->field; *field_ptr; field_ptr++)
1723
1723
  {
1724
1724
    if ((*field_ptr)->vcol_info)
1738
1738
  }
1739
1739
  *vfield_ptr= NULL;                              // End marker
1740
1740
  /* Check virtual columns against table's storage engine. */
1741
 
  if ((share->vfields && outparam->file) && 
 
1741
  if ((share->vfields && outparam->file) &&
1742
1742
        (not outparam->file->check_if_supported_virtual_columns()))
1743
1743
  {
1744
1744
    my_error(ER_UNSUPPORTED_ACTION_ON_VIRTUAL_COLUMN,
1745
 
             MYF(0), 
 
1745
             MYF(0),
1746
1746
             "Specified storage engine");
1747
1747
    error_reported= true;
1748
1748
    goto err;
1809
1809
    }
1810
1810
  }
1811
1811
 
1812
 
#if defined(HAVE_purify) 
 
1812
#if defined(HAVE_purify)
1813
1813
  memset(bitmaps, 0, bitmap_size*3);
1814
1814
#endif
1815
1815
 
2046
2046
  {
2047
2047
    handler *file= 0;
2048
2048
    const char *datext= "";
2049
 
    
 
2049
 
2050
2050
    if (share->db_type() != NULL)
2051
2051
    {
2052
2052
      if ((file= get_new_handler(share, current_session->mem_root,
2073
2073
      csname= tmp;
2074
2074
    }
2075
2075
    my_printf_error(ER_UNKNOWN_COLLATION,
2076
 
                    _("Unknown collation '%s' in table '%-.64s' definition"), 
 
2076
                    _("Unknown collation '%s' in table '%-.64s' definition"),
2077
2077
                    MYF(0), csname, share->table_name.str);
2078
2078
    break;
2079
2079
  }
2081
2081
    strxmov(buff, share->normalized_path.str, reg_ext, NULL);
2082
2082
    my_printf_error(ER_NOT_FORM_FILE,
2083
2083
                    _("Table '%-.64s' was created with a different version "
2084
 
                    "of MySQL and cannot be read"), 
 
2084
                    "of MySQL and cannot be read"),
2085
2085
                    MYF(0), buff);
2086
2086
    break;
2087
2087
  case 8:
2164
2164
 Search after a field with given start & length
2165
2165
 If an exact field isn't found, return longest field with starts
2166
2166
 at right position.
2167
 
 
 
2167
 
2168
2168
 NOTES
2169
2169
   This is needed because in some .frm fields 'fieldnr' was saved wrong
2170
2170
 
2219
2219
/*
2220
2220
  Store an SQL quoted string.
2221
2221
 
2222
 
  SYNOPSIS  
 
2222
  SYNOPSIS
2223
2223
    append_unescaped()
2224
2224
    res         result String
2225
2225
    pos         string to be quoted
2316
2316
    int2store(fileinfo+6,IO_SIZE);              /* Next block starts here */
2317
2317
    for (i= 0; i < keys; i++)
2318
2318
    {
2319
 
      assert(test(key_info[i].flags & HA_USES_COMMENT) == 
 
2319
      assert(test(key_info[i].flags & HA_USES_COMMENT) ==
2320
2320
                 (key_info[i].comment.length > 0));
2321
2321
      if (key_info[i].flags & HA_USES_COMMENT)
2322
2322
        key_comment_total_bytes += 2 + key_info[i].comment.length;
2360
2360
    fileinfo[41]= 0;
2361
2361
    fileinfo[42]= 0;
2362
2362
    int4store(fileinfo+43,create_info->block_size);
2363
 
 
 
2363
 
2364
2364
    fileinfo[44]= 0;
2365
2365
    fileinfo[45]= 0;
2366
2366
    fileinfo[46]= 0;
2587
2587
{
2588
2588
  uint32_t name_length= 0;  // name length in symbols
2589
2589
  bool last_char_is_space= true;
2590
 
  
 
2590
 
2591
2591
  while (*name)
2592
2592
  {
2593
2593
#if defined(USE_MB) && defined(USE_MB_IDENT)
2594
2594
    last_char_is_space= my_isspace(system_charset_info, *name);
2595
2595
    if (use_mb(system_charset_info))
2596
2596
    {
2597
 
      int len=my_ismbchar(system_charset_info, name, 
 
2597
      int len=my_ismbchar(system_charset_info, name,
2598
2598
                          name+system_charset_info->mbmaxlen);
2599
2599
      if (len)
2600
2600
      {
3053
3053
 
3054
3054
/*
3055
3055
  Tell handler we are going to call position() and rnd_pos() later.
3056
 
  
 
3056
 
3057
3057
  NOTES:
3058
3058
  This is needed for handlers that uses the primary key to find the
3059
3059
  row. In this case we have to extend the read bitmap with the primary
3134
3134
    if (key_part->field->vcol_info &&
3135
3135
        key_part->field->vcol_info->expr_item)
3136
3136
      key_part->field->vcol_info->
3137
 
               expr_item->walk(&Item::register_field_in_bitmap, 
 
3137
               expr_item->walk(&Item::register_field_in_bitmap,
3138
3138
                               1, (unsigned char *) bitmap);
3139
3139
  }
3140
3140
}
3282
3282
  mark_virtual_columns();
3283
3283
}
3284
3284
 
3285
 
/* 
 
3285
/*
3286
3286
  @brief Update the write and read table bitmap to allow
3287
3287
         using procedure save_in_field for all virtual columns
3288
3288
         in the table.
3304
3304
  {
3305
3305
    tmp_vfield= *vfield_ptr;
3306
3306
    assert(tmp_vfield->vcol_info && tmp_vfield->vcol_info->expr_item);
3307
 
    tmp_vfield->vcol_info->expr_item->walk(&Item::register_field_in_read_map, 
 
3307
    tmp_vfield->vcol_info->expr_item->walk(&Item::register_field_in_read_map,
3308
3308
                                           1, (unsigned char *) 0);
3309
3309
    bitmap_set_bit(read_set, tmp_vfield->field_index);
3310
3310
    bitmap_set_bit(write_set, tmp_vfield->field_index);
3350
3350
 
3351
3351
  SYNOPSIS
3352
3352
    TableList::containing_subselect()
3353
 
 
 
3353
 
3354
3354
  RETURN
3355
3355
    Subselect item for the subquery that contains the FROM list
3356
3356
    this table is taken from if there is any
3359
3359
*/
3360
3360
 
3361
3361
Item_subselect *TableList::containing_subselect()
3362
 
{    
 
3362
{
3363
3363
  return (select_lex ? select_lex->master_unit()->item : 0);
3364
3364
}
3365
3365
 
3371
3371
      table         the Table to operate on.
3372
3372
 
3373
3373
  DESCRIPTION
3374
 
    The parser collects the index hints for each table in a "tagged list" 
 
3374
    The parser collects the index hints for each table in a "tagged list"
3375
3375
    (TableList::index_hints). Using the information in this tagged list
3376
 
    this function sets the members Table::keys_in_use_for_query, 
 
3376
    this function sets the members Table::keys_in_use_for_query,
3377
3377
    Table::keys_in_use_for_group_by, Table::keys_in_use_for_order_by,
3378
3378
    Table::force_index and Table::covering_keys.
3379
3379
 
3380
3380
    Current implementation of the runtime does not allow mixing FORCE INDEX
3381
 
    and USE INDEX, so this is checked here. Then the FORCE INDEX list 
 
3381
    and USE INDEX, so this is checked here. Then the FORCE INDEX list
3382
3382
    (if non-empty) is appended to the USE INDEX list and a flag is set.
3383
3383
 
3384
 
    Multiple hints of the same kind are processed so that each clause 
 
3384
    Multiple hints of the same kind are processed so that each clause
3385
3385
    is applied to what is computed in the previous clause.
3386
3386
    For example:
3387
3387
        USE INDEX (i1) USE INDEX (i2)
3388
3388
    is equivalent to
3389
3389
        USE INDEX (i1,i2)
3390
3390
    and means "consider only i1 and i2".
3391
 
        
 
3391
 
3392
3392
    Similarly
3393
3393
        USE INDEX () USE INDEX (i1)
3394
3394
    is equivalent to
3397
3397
 
3398
3398
    It is OK to have the same index several times, e.g. "USE INDEX (i1,i1)" is
3399
3399
    not an error.
3400
 
        
 
3400
 
3401
3401
    Different kind of hints (USE/FORCE/IGNORE) are processed in the following
3402
3402
    order:
3403
3403
      1. All indexes in USE (or FORCE) INDEX are added to the mask.
3406
3406
    e.g. "USE INDEX i1, IGNORE INDEX i1, USE INDEX i1" will not use i1 at all
3407
3407
    as if we had "USE INDEX i1, USE INDEX i1, IGNORE INDEX i1".
3408
3408
 
3409
 
    As an optimization if there is a covering index, and we have 
3410
 
    IGNORE INDEX FOR GROUP/order_st, and this index is used for the JOIN part, 
 
3409
    As an optimization if there is a covering index, and we have
 
3410
    IGNORE INDEX FOR GROUP/order_st, and this index is used for the JOIN part,
3411
3411
    then we have to ignore the IGNORE INDEX FROM GROUP/order_st.
3412
3412
 
3413
3413
  RETURN VALUE
3417
3417
bool TableList::process_index_hints(Table *tbl)
3418
3418
{
3419
3419
  /* initialize the result variables */
3420
 
  tbl->keys_in_use_for_query= tbl->keys_in_use_for_group_by= 
 
3420
  tbl->keys_in_use_for_query= tbl->keys_in_use_for_group_by=
3421
3421
    tbl->keys_in_use_for_order_by= tbl->s->keys_in_use;
3422
3422
 
3423
3423
  /* index hint list processing */
3428
3428
    key_map index_group[INDEX_HINT_FORCE + 1];
3429
3429
    Index_hint *hint;
3430
3430
    int type;
3431
 
    bool have_empty_use_join= false, have_empty_use_order= false, 
 
3431
    bool have_empty_use_join= false, have_empty_use_order= false,
3432
3432
         have_empty_use_group= false;
3433
3433
    List_iterator <Index_hint> iter(*index_hints);
3434
3434
 
3466
3466
        continue;
3467
3467
      }
3468
3468
 
3469
 
      /* 
3470
 
        Check if an index with the given name exists and get his offset in 
3471
 
        the keys bitmask for the table 
 
3469
      /*
 
3470
        Check if an index with the given name exists and get his offset in
 
3471
        the keys bitmask for the table
3472
3472
      */
3473
3473
      if (tbl->s->keynames.type_names == 0 ||
3474
3474
          (pos= find_type(&tbl->s->keynames, hint->key_name.str,
3585
3585
{
3586
3586
  Field *new_field;
3587
3587
 
3588
 
  /* 
3589
 
    Make sure that the blob fits into a Field_varstring which has 
3590
 
    2-byte lenght. 
 
3588
  /*
 
3589
    Make sure that the blob fits into a Field_varstring which has
 
3590
    2-byte lenght.
3591
3591
  */
3592
3592
  if (convert_blob_length && convert_blob_length <= Field_varstring::MAX_SIZE &&
3593
3593
      (org_field->flags & BLOB_FLAG))
3769
3769
  */
3770
3770
  if (param->precomputed_group_by)
3771
3771
    copy_func_count+= param->sum_func_count;
3772
 
  
 
3772
 
3773
3773
  init_sql_alloc(&own_root, TABLE_ALLOC_BLOCK_SIZE, 0);
3774
3774
 
3775
3775
  if (!multi_alloc_root(&own_root,
4051
4051
    share->default_values= table->record[1]+alloc_length;
4052
4052
  }
4053
4053
  copy_func[0]=0;                               // End marker
4054
 
  param->func_count= copy_func - param->items_to_copy; 
 
4054
  param->func_count= copy_func - param->items_to_copy;
4055
4055
 
4056
4056
  table->setup_tmp_table_column_bitmaps(bitmaps);
4057
4057
 
4111
4111
    */
4112
4112
    if (default_field[i] && default_field[i]->ptr)
4113
4113
    {
4114
 
      /* 
 
4114
      /*
4115
4115
         default_field[i] is set only in the cases  when 'field' can
4116
4116
         inherit the default value that is defined for the field referred
4117
4117
         by the Item_field object from which 'field' has been created.
4130
4130
        memcpy(field->ptr, orig_field->ptr, field->pack_length());
4131
4131
      }
4132
4132
      orig_field->move_field_offset(-diff);     // Back to record[0]
4133
 
    } 
 
4133
    }
4134
4134
 
4135
4135
    if (from_field[i])
4136
4136
    {                                           /* Not a table Item */
4287
4287
                                                (unsigned char*) 0,
4288
4288
                                                (uint) 0,
4289
4289
                                                Field::NONE,
4290
 
                                                NULL, 
 
4290
                                                NULL,
4291
4291
                                                table->s,
4292
4292
                                                &my_charset_bin);
4293
4293
      if (!key_part_info->field)
4318
4318
 
4319
4319
      if ((*reg_field)->real_maybe_null())
4320
4320
        key_part_info->store_length+= HA_KEY_NULL_LENGTH;
4321
 
      if ((*reg_field)->type() == DRIZZLE_TYPE_BLOB || 
 
4321
      if ((*reg_field)->type() == DRIZZLE_TYPE_BLOB ||
4322
4322
          (*reg_field)->real_type() == DRIZZLE_TYPE_VARCHAR)
4323
4323
        key_part_info->store_length+= HA_KEY_BLOB_LENGTH;
4324
4324
 
4507
4507
      start_recinfo   MyISAM's column descriptions
4508
4508
      recinfo INOUT   End of MyISAM's column descriptions
4509
4509
      options         Option bits
4510
 
   
 
4510
 
4511
4511
  DESCRIPTION
4512
4512
    Create a MyISAM temporary table according to passed description. The is
4513
4513
    assumed to have one unique index or constraint.
4518
4518
         when there are many nullable columns)
4519
4519
      2. Table columns
4520
4520
      3. One free MI_COLUMNDEF element (*recinfo points here)
4521
 
   
 
4521
 
4522
4522
    This function may use the free element to create hash column for unique
4523
4523
    constraint.
4524
4524
 
4527
4527
     true  - Error
4528
4528
*/
4529
4529
 
4530
 
bool Table::create_myisam_tmp_table(KEY *keyinfo, 
 
4530
bool Table::create_myisam_tmp_table(KEY *keyinfo,
4531
4531
                                    MI_COLUMNDEF *start_recinfo,
4532
 
                                    MI_COLUMNDEF **recinfo, 
 
4532
                                    MI_COLUMNDEF **recinfo,
4533
4533
                                    uint64_t options)
4534
4534
{
4535
4535
  int error;
4674
4674
 
4675
4675
bool create_myisam_from_heap(Session *session, Table *table,
4676
4676
                             MI_COLUMNDEF *start_recinfo,
4677
 
                             MI_COLUMNDEF **recinfo, 
 
4677
                             MI_COLUMNDEF **recinfo,
4678
4678
                             int error, bool ignore_last_dupp_key_error)
4679
4679
{
4680
4680
  Table new_table;
4682
4682
  const char *save_proc_info;
4683
4683
  int write_err;
4684
4684
 
4685
 
  if (table->s->db_type() != heap_hton || 
 
4685
  if (table->s->db_type() != heap_hton ||
4686
4686
      error != HA_ERR_RECORD_FILE_FULL)
4687
4687
  {
4688
4688
    table->file->print_error(error,MYF(0));
4700
4700
  session->set_proc_info("converting HEAP to MyISAM");
4701
4701
 
4702
4702
  if (new_table.create_myisam_tmp_table(table->key_info, start_recinfo,
4703
 
                                        recinfo, session->lex->select_lex.options | 
 
4703
                                        recinfo, session->lex->select_lex.options |
4704
4704
                                        session->options))
4705
4705
    goto err2;
4706
4706
  if (new_table.open_tmp_table())
4747
4747
  new_table.s= table->s;                       // Keep old share
4748
4748
  *table= new_table;
4749
4749
  *table->s= share;
4750
 
  
 
4750
 
4751
4751
  table->file->change_table_ptr(table, table->s);
4752
4752
  table->use_all_columns();
4753
4753
  if (save_proc_info)
4886
4886
                           fields do not need updating.
4887
4887
                           This value is false when during INSERT and UPDATE
4888
4888
                           and true in all other cases.
4889
 
 
 
4889
 
4890
4890
  RETURN
4891
4891
    0  - Success
4892
4892
    >0 - Error occurred during the generation/calculation of a virtual field value