298
298
if (type_arg == message::Table::INTERNAL)
300
identifier::Table::build_tmptable_filename(private_key_for_cache.vectorPtr());
300
string s= identifier::Table::build_tmptable_filename();
301
private_key_for_cache.vectorPtr().assign(s.c_str(), s.c_str() + s.size() + 1);
301
302
init(private_key_for_cache.vector(), private_key_for_cache.vector());
456
457
TableShare::TableShare(const identifier::Table::Type type_arg,
457
458
const identifier::Table &identifier,
459
const char *path_arg,
459
460
uint32_t path_length_arg) :
460
461
table_category(TABLE_UNKNOWN_CATEGORY),
461
462
found_next_number_field(NULL),
508
509
keys_for_keyread(0)
512
private_key_for_cache= identifier.getKey();
514
Let us use the fact that the key is "db/0/table_name/0" + optional
515
part for temporary tables.
517
db.str= const_cast<char *>(private_key_for_cache.vector());
518
db.length= strlen(db.str);
519
table_name.str= db.str + db.length + 1;
520
table_name.length= strlen(table_name.str);
511
522
std::string _path;
513
private_key_for_cache= identifier.getKey();
515
Let us use the fact that the key is "db/0/table_name/0" + optional
516
part for temporary tables.
518
db.str= const_cast<char *>(private_key_for_cache.vector());
519
db.length= strlen(db.str);
520
table_name.str= db.str + db.length + 1;
521
table_name.length= strlen(table_name.str);
525
_path.append(path_arg, path_length_arg);
525
_path.assign(path_arg, path_length_arg);
529
identifier::Table::build_table_filename(_path, db.str, table_name.str, false);
529
_path= identifier::Table::build_table_filename(db.str, table_name.str, false);
532
path_buff= (char *)mem_root.alloc(_path.length() + 1);
532
char* path_buff= mem_root.strdup(_path);
533
533
setPath(path_buff, _path.length());
534
strcpy(path_buff, _path.c_str());
535
534
setNormalizedPath(path_buff, _path.length());
537
536
version= g_refresh_version;
610
609
db_create_options= (local_db_create_options & 0x0000FFFF);
611
610
db_options_in_use= db_create_options;
613
block_size= table_options.has_block_size() ?
614
table_options.block_size() : 0;
612
block_size= table_options.has_block_size() ? table_options.block_size() : 0;
616
614
table_charset= get_charset(table_options.collation_id());
765
763
keyinfo->flags|= HA_USES_COMMENT;
766
764
keyinfo->comment.length= indx.comment().length();
767
keyinfo->comment.str= strmake(indx.comment().c_str(), keyinfo->comment.length);
765
keyinfo->comment.str= strdup(indx.comment().c_str(), keyinfo->comment.length);
770
keyinfo->name= strmake(indx.name().c_str(), indx.name().length());
768
keyinfo->name= strdup(indx.name().c_str(), indx.name().length());
772
770
addKeyName(string(keyinfo->name, indx.name().length()));
934
932
for (int n= 0; n < field_options.field_value_size(); n++)
936
t->type_names[n]= strmake(field_options.field_value(n).c_str(), field_options.field_value(n).length());
934
t->type_names[n]= strdup(field_options.field_value(n).c_str(), field_options.field_value(n).length());
939
937
* Go ask the charset what the length is as for "" length=1
1006
1004
size_t len= pfield.comment().length();
1007
1005
const char* str= pfield.comment().c_str();
1009
comment.str= strmake(str, len);
1007
comment.str= strdup(str, len);
1010
1008
comment.length= len;