The world's most popular open source database
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
| #define clear_timestamp_auto_bits | ( | _target_, | |||
| _bits_ | ) | (_target_)= (enum timestamp_auto_set_type)((int)(_target_) & ~(int)(_bits_)) |
Definition at line 101 of file table.h.
Referenced by check_insert_fields(), and check_update_fields().
| #define JOIN_TYPE_RIGHT 2 |
Definition at line 532 of file table.h.
Referenced by st_table_list::first_leaf_for_name_resolution(), st_table_list::last_leaf_for_name_resolution(), mark_common_columns(), and store_top_level_join_columns().
| #define VIEW_ALGORITHM_MERGE 2 |
Definition at line 536 of file table.h.
Referenced by append_algorithm(), check_insert_fields(), make_leaves_list(), mysql_make_view(), mysql_register_view(), st_table_list::prepare_where(), Field_iterator_table_ref::set_field_iterator(), st_table_list::set_underlying_merge(), and setup_tables().
| #define VIEW_ALGORITHM_TMPTABLE 1 |
Definition at line 535 of file table.h.
Referenced by append_algorithm(), mysql_make_view(), and mysql_register_view().
| #define VIEW_ALGORITHM_UNDEFINED 0 |
Definition at line 534 of file table.h.
Referenced by append_algorithm(), fill_defined_view_parts(), and mysql_register_view().
| #define VIEW_CHECK_CASCADED 2 |
| #define VIEW_CHECK_ERROR 1 |
Definition at line 549 of file table.h.
Referenced by mysql_insert(), read_fixed_length(), read_sep_field(), st_table_list::view_check_option(), and write_record().
| #define VIEW_CHECK_LOCAL 1 |
| #define VIEW_CHECK_NONE 0 |
Definition at line 543 of file table.h.
Referenced by get_schema_views_record(), mysql_make_view(), and st_table_list::prep_check_option().
| #define VIEW_CHECK_OK 0 |
| #define VIEW_CHECK_SKIP 2 |
Definition at line 550 of file table.h.
Referenced by mysql_insert(), read_fixed_length(), read_sep_field(), st_table_list::view_check_option(), and write_record().
| #define VIEW_SUID_DEFAULT 2 |
| #define VIEW_SUID_DEFINER 1 |
| #define VIEW_SUID_INVOKER 0 |
| typedef struct st_changed_table_list CHANGED_TABLE_LIST |
| typedef struct st_filesort_info FILESORT_INFO |
| typedef struct st_foreign_key_info FOREIGN_KEY_INFO |
| typedef struct st_grant_info GRANT_INFO |
| typedef struct st_nested_join NESTED_JOIN |
| typedef struct st_open_table_list OPEN_TABLE_LIST |
| typedef struct st_field_info ST_FIELD_INFO |
| typedef struct st_schema_table ST_SCHEMA_TABLE |
| typedef struct st_table_field_w_type TABLE_FIELD_W_TYPE |
| typedef struct st_table_list TABLE_LIST |
| typedef struct st_table_share TABLE_SHARE |
| enum enum_schema_tables |
Definition at line 467 of file table.h.
00468 { 00469 SCH_CHARSETS= 0, 00470 SCH_COLLATIONS, 00471 SCH_COLLATION_CHARACTER_SET_APPLICABILITY, 00472 SCH_COLUMNS, 00473 SCH_COLUMN_PRIVILEGES, 00474 SCH_ENGINES, 00475 SCH_EVENTS, 00476 SCH_FILES, 00477 SCH_KEY_COLUMN_USAGE, 00478 SCH_OPEN_TABLES, 00479 SCH_PARTITIONS, 00480 SCH_PLUGINS, 00481 SCH_PROCESSLIST, 00482 SCH_REFERENTIAL_CONSTRAINTS, 00483 SCH_PROCEDURES, 00484 SCH_SCHEMATA, 00485 SCH_SCHEMA_PRIVILEGES, 00486 SCH_STATISTICS, 00487 SCH_STATUS, 00488 SCH_TABLES, 00489 SCH_TABLE_CONSTRAINTS, 00490 SCH_TABLE_NAMES, 00491 SCH_TABLE_PRIVILEGES, 00492 SCH_TRIGGERS, 00493 SCH_USER_PRIVILEGES, 00494 SCH_VARIABLES, 00495 SCH_VIEWS 00496 };
| enum frm_type_enum |
Definition at line 65 of file table.h.
00066 { 00067 FRMTYPE_ERROR= 0, 00068 FRMTYPE_TABLE, 00069 FRMTYPE_VIEW 00070 };
| enum release_type |
| TIMESTAMP_NO_AUTO_SET | |
| TIMESTAMP_AUTO_SET_ON_INSERT | |
| TIMESTAMP_AUTO_SET_ON_UPDATE | |
| TIMESTAMP_AUTO_SET_ON_BOTH |
Definition at line 96 of file table.h.
00097 { 00098 TIMESTAMP_NO_AUTO_SET= 0, TIMESTAMP_AUTO_SET_ON_INSERT= 1, 00099 TIMESTAMP_AUTO_SET_ON_UPDATE= 2, TIMESTAMP_AUTO_SET_ON_BOTH= 3 00100 };
| enum tmp_table_type |
Definition at line 59 of file table.h.
00060 { 00061 NO_TMP_TABLE, TMP_TABLE, TRANSACTIONAL_TMP_TABLE, 00062 INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE 00063 };
| Item* create_view_field | ( | THD * | thd, | |
| st_table_list * | view, | |||
| Item ** | field_ref, | |||
| const char * | name | |||
| ) |
Definition at line 3462 of file table.cc.
References st_table_list::alias, DBUG_ASSERT, DBUG_ENTER, DBUG_RETURN, Item::fix_fields(), Item::fixed, st_table_list::schema_table_reformed, TRUE, and st_table_list::view.
Referenced by Natural_join_column::create_item(), and Field_iterator_view::create_item().
03464 { 03465 bool save_wrapper= thd->lex->select_lex.no_wrap_view_item; 03466 Item *field= *field_ref; 03467 DBUG_ENTER("create_view_field"); 03468 03469 if (view->schema_table_reformed) 03470 { 03471 /* 03472 Translation table items are always Item_fields and already fixed 03473 ('mysql_schema_table' function). So we can return directly the 03474 field. This case happens only for 'show & where' commands. 03475 */ 03476 DBUG_ASSERT(field && field->fixed); 03477 DBUG_RETURN(field); 03478 } 03479 03480 DBUG_ASSERT(field); 03481 thd->lex->current_select->no_wrap_view_item= TRUE; 03482 if (!field->fixed) 03483 { 03484 if (field->fix_fields(thd, field_ref)) 03485 { 03486 thd->lex->current_select->no_wrap_view_item= save_wrapper; 03487 DBUG_RETURN(0); 03488 } 03489 field= *field_ref; 03490 } 03491 thd->lex->current_select->no_wrap_view_item= save_wrapper; 03492 if (save_wrapper) 03493 { 03494 DBUG_RETURN(field); 03495 } 03496 Item *item= new Item_direct_view_ref(&view->view->select_lex.context, 03497 field_ref, view->alias, 03498 name); 03499 DBUG_RETURN(item); 03500 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void dbug_tmp_restore_column_map | ( | MY_BITMAP * | bitmap, | |
| my_bitmap_map * | old | |||
| ) | [inline, static] |
Definition at line 1063 of file table.h.
References tmp_restore_column_map().
Referenced by convert_constant_item(), store_key_item::copy(), store_key_field::copy(), cp_buffer_from_ref(), ha_tina::encode_quote(), ha_tina::find_current_row(), key_restore(), key_unpack(), mysql_ha_read(), print_key(), print_quick(), Ndb_item::save_in_field(), Item::save_in_field_no_warnings(), Protocol_simple::store(), and store_val_in_field().
01065 { 01066 #ifndef DBUG_OFF 01067 tmp_restore_column_map(bitmap, old); 01068 #endif 01069 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static my_bitmap_map* dbug_tmp_use_all_columns | ( | TABLE * | table, | |
| MY_BITMAP * | bitmap | |||
| ) | [inline, static] |
Definition at line 1053 of file table.h.
References tmp_use_all_columns().
Referenced by convert_constant_item(), store_key_item::copy(), store_key_field::copy(), cp_buffer_from_ref(), ha_tina::encode_quote(), ha_tina::find_current_row(), key_restore(), key_unpack(), mysql_ha_read(), print_key(), print_quick(), Ndb_item::save_in_field(), Item::save_in_field_no_warnings(), Protocol_simple::store(), and store_val_in_field().
01055 { 01056 #ifndef DBUG_OFF 01057 return tmp_use_all_columns(table, bitmap); 01058 #else 01059 return 0; 01060 #endif 01061 }
Here is the call graph for this function:

Here is the caller graph for this function:

| my_bool table_check_intact | ( | TABLE * | table, | |
| uint | table_f_count, | |||
| TABLE_FIELD_W_TYPE * | table_def, | |||
| time_t * | last_create_time, | |||
| int | error_num | |||
| ) |
Definition at line 2372 of file table.cc.
References st_table::alias, buffer, Field::charset(), ha_statistics::create_time, st_table_field_w_type::cset, charset_info_st::csname, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, ER, ER_COL_COUNT_DOESNT_MATCH_CORRUPTED, ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE, error, FALSE, st_table::field, Field::field_name, st_table_share::fields, st_table::file, Field::has_charset(), LEX_STRING::length, my_error(), MYF, st_table_share::mysql_version, MYSQL_VERSION_ID, st_table_field_w_type::name, st_table::s, sql_print_error(), Field::sql_type(), handler::stats, LEX_STRING::str, strcmp(), system_charset_info, TRUE, and st_table_field_w_type::type.
Referenced by Event_scheduler::check_system_tables(), and Events::open_event_table().
02375 { 02376 uint i; 02377 my_bool error= FALSE; 02378 my_bool fields_diff_count; 02379 DBUG_ENTER("table_check_intact"); 02380 DBUG_PRINT("info",("table=%s expected_count=%d",table->alias, table_f_count)); 02381 DBUG_PRINT("info",("last_create_time=%d", *last_create_time)); 02382 02383 if ((fields_diff_count= (table->s->fields != table_f_count)) || 02384 (*last_create_time != table->file->stats.create_time)) 02385 { 02386 DBUG_PRINT("info", ("I am suspecting, checking table")); 02387 if (fields_diff_count) 02388 { 02389 // previous MySQL version 02390 error= TRUE; 02391 if (MYSQL_VERSION_ID > table->s->mysql_version) 02392 { 02393 my_error(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE, MYF(0), table->alias, 02394 table_f_count, table->s->fields, table->s->mysql_version, 02395 MYSQL_VERSION_ID); 02396 sql_print_error(ER(ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE), 02397 table->alias, table_f_count, table->s->fields, 02398 table->s->mysql_version, MYSQL_VERSION_ID); 02399 DBUG_RETURN(error); 02400 02401 } 02402 else if (MYSQL_VERSION_ID == table->s->mysql_version) 02403 { 02404 my_error(ER_COL_COUNT_DOESNT_MATCH_CORRUPTED,MYF(0), table->alias, 02405 table_f_count, table->s->fields); 02406 sql_print_error(ER(ER_COL_COUNT_DOESNT_MATCH_CORRUPTED), table->alias, 02407 table_f_count, table->s->fields); 02408 } 02409 else 02410 { 02411 /* 02412 moving from newer mysql to older one -> let's say not an error but 02413 will check the definition afterwards. If a column was added at the 02414 end then we don't care much since it's not in the middle. 02415 */ 02416 error= FALSE; 02417 } 02418 } 02419 //definitely something has changed 02420 char buffer[255]; 02421 for (i=0 ; i < table_f_count; i++, table_def++) 02422 { 02423 String sql_type(buffer, sizeof(buffer), system_charset_info); 02424 sql_type.length(0); 02425 /* 02426 name changes are not fatal, we use sequence numbers => no prob for us 02427 but this can show tampered table or broken table. 02428 */ 02429 if (i < table->s->fields) 02430 { 02431 Field *field= table->field[i]; 02432 if (strncmp(field->field_name, table_def->name.str, 02433 table_def->name.length)) 02434 { 02435 sql_print_error("(%s) Expected field %s at position %d, found %s", 02436 table->alias, table_def->name.str, i, 02437 field->field_name); 02438 } 02439 02440 /* 02441 IF the type does not match than something is really wrong 02442 Check up to length - 1. Why? 02443 1. datetime -> datetim -> the same 02444 2. int(11) -> int(11 -> the same 02445 3. set('one','two') -> set('one','two' 02446 so for sets if the same prefix is there it's ok if more are 02447 added as part of the set. The same is valid for enum. So a new 02448 table running on a old server will be valid. 02449 */ 02450 field->sql_type(sql_type); 02451 if (strncmp(sql_type.c_ptr_safe(), table_def->type.str, 02452 table_def->type.length - 1)) 02453 { 02454 sql_print_error("(%s) Expected field %s at position %d to have type " 02455 "%s, found %s", table->alias, table_def->name.str, 02456 i, table_def->type.str, sql_type.c_ptr_safe()); 02457 error= TRUE; 02458 } 02459 else if (table_def->cset.str && !field->has_charset()) 02460 { 02461 sql_print_error("(%s) Expected field %s at position %d to have " 02462 "character set '%s' but found no such", table->alias, 02463 table_def->name.str, i, table_def->cset.str); 02464 error= TRUE; 02465 } 02466 else if (table_def->cset.str && 02467 strcmp(field->charset()->csname, table_def->cset.str)) 02468 { 02469 sql_print_error("(%s) Expected field %s at position %d to have " 02470 "character set '%s' but found '%s'", table->alias, 02471 table_def->name.str, i, table_def->cset.str, 02472 field->charset()->csname); 02473 error= TRUE; 02474 } 02475 } 02476 else 02477 { 02478 sql_print_error("(%s) Expected field %s at position %d to have type %s " 02479 " but no field found.", table->alias, 02480 table_def->name.str, i, table_def->type.str); 02481 error= TRUE; 02482 } 02483 } 02484 if (!error) 02485 *last_create_time= table->file->stats.create_time; 02486 else if (!fields_diff_count && error_num) 02487 my_error(error_num,MYF(0), table->alias, table_f_count, table->s->fields); 02488 } 02489 else 02490 { 02491 DBUG_PRINT("info", ("Table seems ok without thorough checking.")); 02492 *last_create_time= table->file->stats.create_time; 02493 } 02494 02495 DBUG_RETURN(error); 02496 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void tmp_restore_column_map | ( | MY_BITMAP * | bitmap, | |
| my_bitmap_map * | old | |||
| ) | [inline, static] |
Definition at line 1045 of file table.h.
References st_bitmap::bitmap.
Referenced by dbug_tmp_restore_column_map(), and store_create_info().
01047 { 01048 bitmap->bitmap= old; 01049 }
Here is the caller graph for this function:

| static my_bitmap_map* tmp_use_all_columns | ( | TABLE * | table, | |
| MY_BITMAP * | bitmap | |||
| ) | [inline, static] |
Definition at line 1036 of file table.h.
References st_table_share::all_set, st_bitmap::bitmap, and st_table::s.
Referenced by dbug_tmp_use_all_columns(), and store_create_info().
01038 { 01039 my_bitmap_map *old= bitmap->bitmap; 01040 bitmap->bitmap= table->s->all_set.bitmap; 01041 return old; 01042 }
Here is the caller graph for this function:

1.4.7

