summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorShishir Jaiswal <shishir.j.jaiswal@oracle.com>2017-05-16 13:48:52 +0530
committerShishir Jaiswal <shishir.j.jaiswal@oracle.com>2017-05-16 13:48:52 +0530
commit3b562dcf6e5423d41d41ef416c18187c3a946d9e (patch)
tree7c061baabc1ca78e1cf6b1a6aa1cfbac9a0273f5 /sql/sql_load.cc
parentf4ce18b0a6954c01579698d2865e5c3aa8763df7 (diff)
downloadmariadb-git-3b562dcf6e5423d41d41ef416c18187c3a946d9e.tar.gz
Bug#16212207 - LOAD XML INFILE PERFORMANCE WITH INDENTED
XML DESCRIPTION =========== LOAD XML INFILE performance becomes painfully slow if the tags' value has any space(s) in between them. They're usually kept intentionally for indentation purpose. ANALYSIS ======== The extra spaces are calling clear_level() many a times which is having overhead of clearing taglist etc. This can be avoided altogether by skipping all such spaces. FIX === Trim all the starting whitespaces from the value before passing it to read_value()
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index c28c7cdb2db..a2c01c3b8a8 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1989,6 +1989,13 @@ int READ_INFO::read_xml()
case '>': /* end tag - read tag value */
in_tag= false;
+ /* Skip all whitespaces */
+ while (' ' == (chr= my_tospace(GET)));
+ /*
+ Push the first non-whitespace char back to Stack. This char would be
+ read in the upcoming call to read_value()
+ */
+ PUSH(chr);
chr= read_value('<', &value);
if(chr == my_b_EOF)
goto found_eof;