diff options
| author | Alexander Barkov <bar@mariadb.org> | 2016-11-18 15:40:45 +0400 |
|---|---|---|
| committer | Alexander Barkov <bar@mariadb.org> | 2017-03-24 16:27:11 +0400 |
| commit | 0d8b1050c9977478195160ced955e67df1cd3263 (patch) | |
| tree | 8f5ea51452d50acac0f38e370b6b5d8ddf0eec34 | |
| parent | 1b3bd00c6b517dec73b35672875aeda9f2143bed (diff) | |
| download | mariadb-git-0d8b1050c9977478195160ced955e67df1cd3263.tar.gz | |
MDEV-11245 Move prepare_create_field and sp_prepare_create_field() as methods to Column_definition
Some upcoming tasks, e.g.:
- MDEV-10577 sql_mode=ORACLE: %TYPE in variable declarations
- MDEV-10914 ROW data type for stored routine variables
will need to reuse the code implemented in prepare_create_field(),
sp_prepare_create_field(), prepare_blob_field().
Before reusing this code, it's a good idea to move these global functions
as methods to Column_definition.
This patch:
- actually moves prepare_create_field(), sp_prepare_create_field(),
prepare_blob_field() as methods to Column_definition
- makes sp_prepare_create_field() call prepare_create_field() at the end,
to avoid duplicate code in MDEV-10577 and MDEV-10914.
- changes the return data type for prepare_create_field() from int to bool,
to make it consistent with all other functions returning "ok" or "error".
- moves the implementation sp_head::fill_field_definition() from sp_head.cc
to sp_head.h, as it now uses globally visible Column_definition methods,
and is very simple, so inlining is now possible.
- removes the unused "LEX*" argument from sp_head::fill_field_definition()
| -rw-r--r-- | sql/sql_table.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7c06ff96c32..728416c8df6 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2874,7 +2874,7 @@ bool Column_definition::prepare_create_field(uint *blob_columns, if (!(table_flags & HA_CAN_GEOMETRY)) { my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "GEOMETRY"); - DBUG_RETURN(1); + DBUG_RETURN(true); } pack_flag= FIELDFLAG_GEOM | pack_length_to_packflag(pack_length - portable_sizeof_char_ptr); |
