diff options
author | Alexander Barkov <bar@mariadb.org> | 2016-11-02 18:04:35 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2016-12-16 17:31:40 +0400 |
commit | e5dfe04da02244e592db0b5955a4d95148e0928a (patch) | |
tree | bfb8e3fe124d856e60e261c80afabb58a882bc0b /sql/table.h | |
parent | 239287b22e7bb7dfe27970ac2f32f8874f24229c (diff) | |
download | mariadb-git-e5dfe04da02244e592db0b5955a4d95148e0928a.tar.gz |
MDEV-11146 SP variables of the SET data type erroneously allow values with comma
There was a duplicate code to create TYPELIB from List<String>:
- In typelib() and mysql_prepare_create_table(), which was used to initialize
table fields.
- create_typelib() and sp_prepare_create_field(), which was used to initialize
SP variables.
create_typelib() was incomplete and didn't check for wrong SET values.
Fix:
- Moving the code from create_typelib() and mysql_prepare_create_field()
to news methods Column_definition::create_interval_from_interval_list()
and Column_definition::prepare_interval_field().
- Moving the code from calculate_interval_lengths() in sql_table.cc
to a new method Column_definition::calculate_interval_lengths(), as it's now
needed only in Column_definition::create_interval_from_interval_list()
- Reusing the new method Column_definition::prepare_interval_field() in both
mysql_prepare_create_table() and sp_prepare_create_field(), instead of the
old duplicate code pieces
- Removing global functions typelib() and create_typelib()
This patch also fixes:
MDEV-11155 Bad error message when creating a SET column with comma and non-ASCII characters
The problem was that ErrCongString() was called with a wrong "charset" parameter.
Diffstat (limited to 'sql/table.h')
-rw-r--r-- | sql/table.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/table.h b/sql/table.h index c2c523181a0..e68f4ec8563 100644 --- a/sql/table.h +++ b/sql/table.h @@ -2736,7 +2736,6 @@ inline bool is_infoschema_db(const char *name) INFORMATION_SCHEMA_NAME.str, name); } -TYPELIB *typelib(MEM_ROOT *mem_root, List<String> &strings); inline void mark_as_null_row(TABLE *table) { |