summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-12-12 23:38:59 +0300
committerAlexander Nozdrin <alik@sun.com>2009-12-12 23:38:59 +0300
commitbc2d4e620ac81824b2e30bf8a1c92e164717b2e1 (patch)
tree2a2432e481d124691d9fa4b39d8a192264178bd1 /sql/table.h
parentbd1f8f5bfaf9748ca445401687cca97a89e0dfee (diff)
parent69cfd5c8ecd20bca0e651efcbb8b5affc24c1af4 (diff)
downloadmariadb-git-bc2d4e620ac81824b2e30bf8a1c92e164717b2e1.tar.gz
Manual merge from mysql-trunk-merge.
Conflicts: - extra/comp_err.c - mysql-test/collections/default.experimental - mysql-test/r/archive.result - mysql-test/r/select.result - mysql-test/suite/binlog/r/binlog_unsafe.result - mysql-test/suite/binlog/t/binlog_unsafe.test - mysql-test/suite/rpl/t/disabled.def - mysql-test/t/archive.test - mysql-test/t/select.test - sql/item.cc - sql/item.h - sql/item_timefunc.cc - sql/sql_base.cc - sql/sql_delete.cc - sql/sql_load.cc - sql/sql_partition.cc - sql/sql_table.cc - storage/innobase/handler/ha_innodb.cc - vio/vio.c
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h53
1 files changed, 42 insertions, 11 deletions
diff --git a/sql/table.h b/sql/table.h
index 03220487684..e2f47c9c588 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -288,6 +288,36 @@ typedef enum enum_table_category TABLE_CATEGORY;
TABLE_CATEGORY get_table_category(const LEX_STRING *db,
const LEX_STRING *name);
+
+typedef struct st_table_field_type
+{
+ LEX_STRING name;
+ LEX_STRING type;
+ LEX_STRING cset;
+} TABLE_FIELD_TYPE;
+
+
+typedef struct st_table_field_def
+{
+ uint count;
+ const TABLE_FIELD_TYPE *field;
+} TABLE_FIELD_DEF;
+
+
+class Table_check_intact
+{
+protected:
+ virtual void report_error(uint code, const char *fmt, ...)= 0;
+
+public:
+ Table_check_intact() {}
+ virtual ~Table_check_intact() {}
+
+ /** Checks whether a table is intact. */
+ bool check(TABLE *table, const TABLE_FIELD_DEF *table_def);
+};
+
+
/*
This structure is shared between different table objects. There is one
instance of table share per one table in the database.
@@ -420,6 +450,18 @@ struct TABLE_SHARE
handlerton *default_part_db_type;
#endif
+ /**
+ Cache the checked structure of this table.
+
+ The pointer data is used to describe the structure that
+ a instance of the table must have. Each element of the
+ array specifies a field that must exist on the table.
+
+ The pointer is cached in order to perform the check only
+ once -- when the table is loaded from the disk.
+ */
+ const TABLE_FIELD_DEF *table_field_def_cache;
+
/** place to store storage engine specific data */
void *ha_data;
void (*ha_data_destroy)(void *); /* An optional destructor for ha_data */
@@ -1626,17 +1668,6 @@ typedef struct st_open_table_list{
uint32 in_use,locked;
} OPEN_TABLE_LIST;
-typedef struct st_table_field_w_type
-{
- LEX_STRING name;
- LEX_STRING type;
- LEX_STRING cset;
-} TABLE_FIELD_W_TYPE;
-
-
-my_bool
-table_check_intact(TABLE *table, const uint table_f_count,
- const TABLE_FIELD_W_TYPE *table_def);
static inline my_bitmap_map *tmp_use_all_columns(TABLE *table,
MY_BITMAP *bitmap)