1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-19906 Port show_old_temporals from MySQL 5.6

Old temporal data types (created with a pre-10.0 version of MariaDB)
are now displayed with a /* mariadb-5.3 */ comment in:

- SHOW CREATE TABLE
- DESCRIBE
- INFORMATION_SCHEMA.COLUMNS.COLUMN_TYPE

For example:

CREATE TABLE `t1` (
  `t0` datetime /* mariadb-5.3 */ DEFAULT NULL,
  `t6` datetime(6) /* mariadb-5.3 */ DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1

Note, new temporal data types are displayed without a format comment.
This commit is contained in:
Alexander Barkov
2020-01-16 13:29:29 +04:00
parent e7558d4760
commit 6f65931f88
10 changed files with 376 additions and 53 deletions

View File

@ -3326,8 +3326,6 @@ class Type_handler
{
Name m_name;
protected:
const Name version_mysql56() const;
const Name version_mariadb53() const;
String *print_item_value_csstr(THD *thd, Item *item, String *str) const;
String *print_item_value_temporal(THD *thd, Item *item, String *str,
const Name &type_name, String *buf) const;
@ -3390,6 +3388,8 @@ public:
static void partition_field_type_not_allowed(const LEX_CSTRING &field_name);
static bool partition_field_check_result_type(Item *item,
Item_result expected_type);
static const Name & version_mysql56();
static const Name & version_mariadb53();
void set_name(Name n) { DBUG_ASSERT(!m_name.ptr()); m_name= n; }
const Name name() const { return m_name; }