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

MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY

This commit is contained in:
Alexander Barkov
2020-03-10 16:05:42 +04:00
parent 00749980ac
commit e40858a7bd
35 changed files with 895 additions and 10 deletions

View File

@ -23,6 +23,7 @@
#include "mysqld.h"
#include "lex_string.h"
#include "sql_array.h"
#include "sql_const.h"
#include "sql_time.h"
@ -138,6 +139,41 @@ enum column_definition_type_t
};
class Send_field_extended_metadata
{
LEX_CSTRING m_attr[MARIADB_FIELD_ATTR_LAST+1];
public:
Send_field_extended_metadata()
{
bzero(this, sizeof(*this));
}
bool set_data_type_name(const LEX_CSTRING &str)
{
m_attr[MARIADB_FIELD_ATTR_DATA_TYPE_NAME]= str;
return false;
}
bool set_format_name(const LEX_CSTRING &str)
{
m_attr[MARIADB_FIELD_ATTR_FORMAT_NAME]= str;
return false;
}
bool has_extended_metadata() const
{
for (uint i= 0; i <= MARIADB_FIELD_ATTR_LAST; i++)
{
if (m_attr[i].str)
return true;
}
return false;
}
const LEX_CSTRING &attr(uint i) const
{
DBUG_ASSERT(i <= MARIADB_FIELD_ATTR_LAST);
return m_attr[i];
}
};
class Data_type_statistics
{
public:
@ -3435,6 +3471,11 @@ public:
return field_type();
}
virtual protocol_send_type_t protocol_send_type() const= 0;
virtual bool Item_append_extended_type_info(Send_field_extended_metadata *to,
const Item *item) const
{
return false;
}
virtual Item_result result_type() const= 0;
virtual Item_result cmp_type() const= 0;
virtual enum_dynamic_column_type