summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2009-07-31 22:14:52 +0500
committerGleb Shchepa <gshchepa@mysql.com>2009-07-31 22:14:52 +0500
commite642140b182e4ba0688b91c0870dfb5500b149f0 (patch)
treed3022917ee0647bbcdfe1a41e7b73aa60a6ebd7f /sql/sql_load.cc
parente1c43705b9bf19e5167a2bfb5b539eb98d0197c2 (diff)
downloadmariadb-git-e642140b182e4ba0688b91c0870dfb5500b149f0.tar.gz
Bug# 30946: mysqldump silently ignores --default-character-set
when used with --tab 1) New syntax: added CHARACTER SET clause to the SELECT ... INTO OUTFILE (to complement the same clause in LOAD DATA INFILE). mysqldump is updated to use this in --tab mode. 2) ESCAPED BY/ENCLOSED BY field parameters are documented as accepting CHAR argument, however SELECT .. INTO OUTFILE silently ignored rests of multisymbol arguments. For the symmetrical behavior with LOAD DATA INFILE the server has been modified to fail with the same error: ERROR 42000: Field separator argument is not what is expected; check the manual 3) Current LOAD DATA INFILE recognizes field/line separators "as is" without converting from client charset to data file charset. So, it is supposed, that input file of LOAD DATA INFILE consists of data in one charset and separators in other charset. For the compatibility with that [buggy] behaviour SELECT INTO OUTFILE implementation has been saved "as is" too, but the new warning message has been added: Non-ASCII separator arguments are not fully supported This message warns on field/line separators that contain non-ASCII symbols.
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 1758a6df5f9..b7f33d51335 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -148,6 +148,17 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
MYF(0));
DBUG_RETURN(TRUE);
}
+
+ /* Report problems with non-ascii separators */
+ if (!escaped->is_ascii() || !enclosed->is_ascii() ||
+ !field_term->is_ascii() ||
+ !ex->line_term->is_ascii() || !ex->line_start->is_ascii())
+ {
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED,
+ ER(WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED));
+ }
+
if (open_and_lock_tables(thd, table_list))
DBUG_RETURN(TRUE);
if (setup_tables_and_check_access(thd, &thd->lex->select_lex.context,