summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h50
1 files changed, 28 insertions, 22 deletions
diff --git a/sql/table.h b/sql/table.h
index 1e9dad75b70..46a2ec6c49d 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1,8 +1,7 @@
#ifndef TABLE_INCLUDED
#define TABLE_INCLUDED
-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
- Copyright (c) 2009, 2014, SkySQL Ab.
- Copyright (c) 2016, 2017, MariaDB Corporation.
+/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2018, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -487,10 +486,11 @@ typedef struct st_table_field_def
class Table_check_intact
{
protected:
+ bool has_keys;
virtual void report_error(uint code, const char *fmt, ...)= 0;
public:
- Table_check_intact() {}
+ Table_check_intact(bool keys= false) : has_keys(keys) {}
virtual ~Table_check_intact() {}
/** Checks whether a table is intact. */
@@ -505,6 +505,8 @@ class Table_check_intact_log_error : public Table_check_intact
{
protected:
void report_error(uint, const char *fmt, ...);
+public:
+ Table_check_intact_log_error() : Table_check_intact(true) {}
};
@@ -1825,8 +1827,22 @@ public:
fix_item();
}
void empty() { unit= VERS_UNDEFINED; item= NULL; }
- void print(String *str, enum_query_type, const char *prefix, size_t plen);
- void resolve_unit(bool timestamps_only);
+ void print(String *str, enum_query_type, const char *prefix, size_t plen) const;
+ bool resolve_unit(THD *thd);
+ bool resolve_unit_trx_id(THD *thd)
+ {
+ if (unit == VERS_UNDEFINED)
+ unit= VERS_TRX_ID;
+ return false;
+ }
+ bool resolve_unit_timestamp(THD *thd)
+ {
+ if (unit == VERS_UNDEFINED)
+ unit= VERS_TIMESTAMP;
+ return false;
+ }
+ void bad_expression_data_type_error(const char *type) const;
+ bool eq(const vers_history_point_t &point) const;
};
struct vers_select_conds_t
@@ -1855,27 +1871,20 @@ struct vers_select_conds_t
end= _end;
}
- void print(String *str, enum_query_type query_type);
+ void print(String *str, enum_query_type query_type) const;
bool init_from_sysvar(THD *thd);
- bool operator== (vers_system_time_t b)
- {
- return type == b;
- }
- bool operator!= (vers_system_time_t b)
- {
- return type != b;
- }
- operator bool() const
+ bool is_set() const
{
return type != SYSTEM_TIME_UNSPECIFIED;
}
- void resolve_units(bool timestamps_only);
+ bool resolve_units(THD *thd);
bool user_defined() const
{
return !from_query && type != SYSTEM_TIME_UNSPECIFIED;
}
+ bool eq(const vers_select_conds_t &conds) const;
};
/*
@@ -2259,7 +2268,7 @@ struct TABLE_LIST
/* TABLE_TYPE_UNKNOWN if any type is acceptable */
Table_type required_type;
handlerton *db_type; /* table_type for handler */
- char timestamp_buffer[20]; /* buffer for timestamp (19+1) */
+ char timestamp_buffer[MAX_DATETIME_WIDTH + 1];
/*
This TABLE_LIST object is just placeholder for prelocking, it will be
used for implicit LOCK TABLES only and won't be used in real statement.
@@ -2291,8 +2300,6 @@ struct TABLE_LIST
/* TODO: replace with derived_type */
bool merged;
bool merged_for_insert;
- /* TRUE <=> don't prepare this derived table/view as it should be merged.*/
- bool skip_prepare_derived;
bool sequence; /* Part of NEXTVAL/CURVAL/LASTVAL */
/*
@@ -2302,7 +2309,6 @@ struct TABLE_LIST
List<Item> used_items;
/* Sublist (tail) of persistent used_items */
List<Item> persistent_used_items;
- Item **materialized_items;
/* View creation context. */
@@ -2871,7 +2877,7 @@ enum get_table_share_flags {
GTS_FORCE_DISCOVERY = 16
};
-size_t max_row_length(TABLE *table, const uchar *data);
+size_t max_row_length(TABLE *table, MY_BITMAP const *cols, const uchar *data);
void init_mdl_requests(TABLE_LIST *table_list);