Skip to content

Commit 3b562dc

Browse files
author
Shishir Jaiswal
committed
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()
1 parent f4ce18b commit 3b562dc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sql/sql_load.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -1989,6 +1989,13 @@ int READ_INFO::read_xml()
19891989

19901990
case '>': /* end tag - read tag value */
19911991
in_tag= false;
1992+
/* Skip all whitespaces */
1993+
while (' ' == (chr= my_tospace(GET)));
1994+
/*
1995+
Push the first non-whitespace char back to Stack. This char would be
1996+
read in the upcoming call to read_value()
1997+
*/
1998+
PUSH(chr);
19921999
chr= read_value('<', &value);
19932000
if(chr == my_b_EOF)
19942001
goto found_eof;

0 commit comments

Comments
 (0)