diff options
author | bar@mysql.com <> | 2007-02-28 17:06:57 +0400 |
---|---|---|
committer | bar@mysql.com <> | 2007-02-28 17:06:57 +0400 |
commit | dd0c43d5fa36337c69750ff4deb7b34d560855de (patch) | |
tree | 08757272c814e1759ead34b34a2311273d1cf48d /sql/sql_load.cc | |
parent | 2f75c9cd69412de5d3736e775dd302ebdbc1e36d (diff) | |
download | mariadb-git-dd0c43d5fa36337c69750ff4deb7b34d560855de.tar.gz |
Bug#15126 character_set_database is not replicated (LOAD DATA INFILE need it)
This patch fixes problem that LOAD DATA could use different
character sets when loading files on master and on slave sides:
- Adding replication of thd->variables.collation_database
- Adding optional character set clause into LOAD DATA
Note, the second way, with explicit CHARACTER SET clause
should be the recommended way to load data using an alternative
character set.
The old way, using "SET @@character_set_database=xxx" should be
gradually depricated.
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r-- | sql/sql_load.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 0e4057d9ae4..d971eae56c0 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -313,7 +313,8 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, info.handle_duplicates=handle_duplicates; info.escape_char=escaped->length() ? (*escaped)[0] : INT_MAX; - READ_INFO read_info(file,tot_length,thd->variables.collation_database, + READ_INFO read_info(file,tot_length, + ex->cs ? ex->cs : thd->variables.collation_database, *field_term,*ex->line_start, *ex->line_term, *enclosed, info.escape_char, read_file_from_client, is_fifo); if (read_info.error) |