mariadb/include
Alexander Barkov dd0ff30278 MDEV-11343 LOAD DATA INFILE fails to load data with an escape character followed by a multi-byte character
Partially backporting MDEV-9874 from 10.2 to 10.0

READ_INFO::read_field() raised the ER_INVALID_CHARACTER_STRING error
when reading an escape character followed by a multi-byte character.

Raising wellformedness errors in READ_INFO::read_field() was wrong,
because the main goal of READ_INFO::read_field() is to *unescape* the
data which was presumably escaped using mysql_real_escape_string(),
using the same character set with the one specified in
"LOAD DATA INFILE ... CHARACTER SET ..." (or assumed by default).

During LOAD DATA, multi-byte characters are not always scanned as a single
entity! In case of escaped data, parts of a multi-byte character can be
scanned on different loop iterations. So the old code erroneously tested
welformedness in the middle of a multi-byte character.

Moreover, the data after unescaping can go into a BLOB field, not a text field.
Wellformedness tests are meaningless in this case.

Ater this patch, wellformedness is only checked later, during
Field::store(str,length,cs) time. The loop that scans bytes only
makes sure to revert the changes made by mysql_real_escape_string().

Note, in some cases users can supply data which did not really go through
mysql_real_escape_string() and was escaped by some other means,
or was not escaped at all. The file reported in this MDEV contains
the string "\ä", which is an example of such improperly escaped data, as
- either there should be two backslashes:   "\\ä"
- or there should be no backslashes at all: "ä"
mysql_real_escape_string() could not generate "\ä".
2016-11-29 06:51:12 +04:00
..
atomic MDEV-7398 mysqld segfaults on FreeBSD 10.1 i386 when built with clang 3.4 2015-06-16 23:58:21 +02:00
mysql Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
base64.h Merging TO_BASE64() and FROM_BASE64() from MySQL-5.6 2013-09-23 18:58:33 +04:00
big_endian.h Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
byte_order_generic.h Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
byte_order_generic_x86.h MDEV-10951 Field_newdate::cmp access violation 2016-10-25 22:35:35 +00:00
byte_order_generic_x86_64.h MDEV-10951 Field_newdate::cmp access violation 2016-10-25 22:35:35 +00:00
CMakeLists.txt Merge branch '5.5' into bb-10.0 2016-06-21 14:11:02 +02:00
decimal.h remove unneded #include's that had a dubious explanation 2015-10-24 19:58:34 +02:00
errmsg.h 5.5.38 merge 2014-06-06 00:07:27 +02:00
ft_global.h mysql-5.1.73 merge 2014-03-15 18:24:15 +01:00
handler_ername.h Fix for MDEV-5547: Bad error message when moving very old .frm files to MariaDB 5.5. 2014-01-22 15:16:57 +02:00
handler_state.h Fix for MDEV-533: Confusing error code when doing auto-increment insert for out-of-range values 2012-09-18 15:14:19 +03:00
hash.h MDEV-9024 Build fails with VS2015 2015-11-06 17:27:24 +01:00
heap.h 5.5 merge 2014-03-26 22:25:38 +01:00
keycache.h Fixed problem with very slow shutdown when using 100,000 MyISAM tables with delay_key_write 2014-07-19 17:46:08 +03:00
lf.h cleanup: remove LF_REQUIRE_PINS, use compile_time_assert() instead of reimplementing it 2013-06-24 20:56:55 +02:00
little_endian.h Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
m_ctype.h MDEV-11343 LOAD DATA INFILE fails to load data with an escape character followed by a multi-byte character 2016-11-29 06:51:12 +04:00
m_string.h MDEV-5120 Test suite test maria-no-logging fails 2014-09-30 20:31:14 +03:00
ma_dyncol.h MDEV-5404 Can't free data returned by mariadb_dyncol_unpack on windows 2014-03-19 09:58:18 +01:00
maria.h MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_to_client() 2015-09-06 22:26:33 +02:00
my_aes.h Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
my_alarm.h MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_to_client() 2015-09-06 22:26:33 +02:00
my_alloc.h mysql-5.1.73 merge 2014-03-15 18:24:15 +01:00
my_atomic.h mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
my_attribute.h 5.1 merge 2014-03-16 13:59:44 +01:00
my_base.h MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_to_client() 2015-09-06 22:26:33 +02:00
my_bit.h merge with 5.3 2011-10-19 21:45:18 +02:00
my_bitmap.h jemalloc compatibility 2014-10-08 00:45:41 +02:00
my_byteorder.h Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
my_check_opt.h 5.5 merge 2015-01-21 12:03:02 +01:00
my_compare.h 5.2 merge 2014-03-16 21:03:01 +01:00
my_compiler.h mysql-5.1.73 merge 2014-03-15 18:24:15 +01:00
my_context.h Fix spelling: occurred, execute, which etc 2016-03-04 02:09:37 +02:00
my_cpu.h MDEV-6450 - MariaDB crash on Power8 when built with advance tool chain 2014-08-19 19:28:35 +03:00
my_dbug.h MDEV-8379 - SUSE mariadb patches 2015-10-01 13:04:59 +04:00
my_decimal_limits.h 5.3 merge 2012-01-13 15:50:02 +01:00
my_default.h Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
my_dir.h 5.2 merge 2014-03-16 21:03:01 +01:00
my_getopt.h 10.0-base merge 2014-02-26 15:28:07 +01:00
my_global.h Merge branch '5.5' into 10.0 2016-09-27 09:21:19 +02:00
my_handler_errors.h merge of "BUG#18233051 - FTS: FAILING ASSERTION: NUM_TOKEN < MAX_PROXIMITY_ITEM" 2014-05-07 22:36:40 +02:00
my_libwrap.h Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
my_list.h Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
my_md5.h 10.0-monty merge 2013-07-21 16:39:19 +02:00
my_net.h 10.0-base merge 2014-02-26 15:28:07 +01:00
my_nosys.h Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
my_pthread.h MDEV-9024 Build fails with VS2015 2016-02-06 22:41:58 +01:00
my_rdtsc.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_rnd.h Temporary commit of 10.0-merge 2013-03-26 00:03:13 +02:00
my_stacktrace.h [MDEV-9127] Crash reporter often fails to show the query that crashed 2016-07-12 11:58:20 +03:00
my_sys.h Merge branch '5.5' into 10.0 2016-09-27 09:21:19 +02:00
my_time.h 5.5.38 merge 2014-06-06 00:07:27 +02:00
my_tree.h Merge branch '5.5' into bb-10.0 2016-06-21 14:11:02 +02:00
my_uctype.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
my_user.h support DEFINER=role and DEFINER=current_role 2013-10-18 12:17:49 -07:00
my_valgrind.h 10.0-base merge 2014-02-26 15:28:07 +01:00
my_xml.h MDEV-4928 Merge collation customization improvements 2013-10-02 15:04:07 +04:00
myisam.h Merge branch '5.5' into bb-10.0 2016-06-21 14:11:02 +02:00
myisamchk.h Merge branch '5.5' into 10.0 2015-05-04 22:00:24 +02:00
myisammrg.h fix merge.test: online alter table support for MERGE tables, really 2013-07-11 18:57:11 +02:00
myisampack.h mysql-5.1.73 merge 2014-03-15 18:24:15 +01:00
mysql.h MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_to_client() 2015-09-06 22:26:33 +02:00
mysql.h.pp Fixed "Packets out of order" warning message on stdout in clients, 2016-08-21 20:38:47 +03:00
mysql_async.h MDEV-3802: Millisecond timeout support in non-blocking client library + fix incorrect blocking. 2012-10-12 11:00:01 +02:00
mysql_com.h Fixed "Packets out of order" warning message on stdout in clients, 2016-08-21 20:38:47 +03:00
mysql_com_server.h Next part of merge. See TODO for details 2012-08-14 17:23:34 +03:00
mysql_embed.h 5.3 merge 2012-01-13 15:50:02 +01:00
mysql_time.h 10.0-base merge 2013-07-18 16:46:57 +02:00
mysql_version.h.in mysql-5.5.37 selective merge 2014-03-27 22:26:58 +01:00
mysqld_default_groups.h MDEV-4068 rpm scriptlet chown command dangerous 2013-03-06 09:32:13 +01:00
mysys_err.h 5.3 merge 2012-01-13 15:50:02 +01:00
password.h Do the partial merge of WL#5602 correctly: 2013-12-09 12:38:02 +01:00
probes_mysql.d.base Updated/added copyright headers 2011-06-30 17:46:53 +02:00
probes_mysql.h more portable fix for lp:942266 - 5.5 builds fail with systemtap-sdt-dev installed on Ubuntu 2012-05-11 09:18:00 +02:00
probes_mysql_nodtrace.h.in Merge branch '5.5' into 10.0 2016-02-15 22:50:59 +01:00
queues.h MDEV-4984: Implement MASTER_GTID_WAIT() and @@LAST_GTID. 2014-02-07 19:15:28 +01:00
rijndael.h Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
service_versions.h MroongaSE: addint thd_autoinc and thd_error_context plugin services 2013-12-12 19:18:49 +04:00
sha1.h SHA1 service 2013-07-13 17:48:06 +02:00
sha2.h Updated/added copyright headers 2011-06-30 17:46:53 +02:00
sql_common.h 5.2 merge 2014-03-16 21:03:01 +01:00
sslopt-case.h WL#9072: Backport WL#8785 to 5.5 2016-02-19 23:31:10 +04:00
sslopt-longopts.h WL#9072: Backport WL#8785 to 5.5 2016-02-19 23:31:10 +04:00
sslopt-vars.h WL#9072: Backport WL#8785 to 5.5 2016-02-19 23:31:10 +04:00
t_ctype.h Updated/added copyright header. Added line "use is subject to license terms" 2014-02-17 18:19:04 +05:30
thr_alarm.h 5.2 merge 2014-03-16 21:03:01 +01:00
thr_lock.h Merge with 5.2. 2011-12-11 11:34:44 +02:00
thread_pool_priv.h 5.5.39 merge 2014-08-07 18:06:56 +02:00
typelib.h mysql-5.1.73 merge 2014-03-15 18:24:15 +01:00
violite.h MDEV-9366 : do_shutdown_server fails to detect server shutdown on Windows. 2016-06-08 17:13:49 +00:00
waiting_threads.h use PSI wrappers in aria and other non-MySQL code 2011-07-13 21:10:18 +02:00
welcome_copyright_notice.h Merge branch 'mysql/5.5' into 5.5 2016-02-09 11:27:40 +01:00
wqueue.h fix the include guards and add missing gplv2 headers 2012-02-17 12:19:38 +01:00