diff options
author | unknown <jimw@mysql.com> | 2005-01-17 12:22:23 -0800 |
---|---|---|
committer | unknown <jimw@mysql.com> | 2005-01-17 12:22:23 -0800 |
commit | 3752c3b33bac1d6d647845ecd800183693a13cf9 (patch) | |
tree | a346b568fc8871a3a9351af794ea7b4a4ec70397 /sql/table.cc | |
parent | 0b076d2c1fa0df44033ca43a5f384eefaba71c9b (diff) | |
download | mariadb-git-3752c3b33bac1d6d647845ecd800183693a13cf9.tar.gz |
Print a warning when an old table (with no character set stored) is opened
and the default character set is multi-byte, which will result in character
column size changes. (Bug #6913)
sql/table.cc:
Print a warning when an old table is opened and the
default character set is multi-byte that warns about
character column sizes possibly getting changed
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index 5ede9c1e43d..4be69a40782 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -145,8 +145,19 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, outparam->table_charset=get_charset((uint) head[38],MYF(0)); null_field_first=1; } - if (!outparam->table_charset) /* unknown charset in head[38] or pre-3.23 frm */ + if (!outparam->table_charset) + { + /* unknown charset in head[38] or pre-3.23 frm */ + if (use_mb(default_charset_info)) + { + /* Warn that we may be changing the size of character columns */ + sql_print_warning("'%s' had no or invalid character set, " + "and default character set is multi-byte, " + "so character column sizes may have changed", + name); + } outparam->table_charset=default_charset_info; + } outparam->db_record_offset=1; if (db_create_options & HA_OPTION_LONG_BLOB_PTR) outparam->blob_ptr_size=portable_sizeof_char_ptr; |