Commit graph

10 commits

Author SHA1 Message Date
Sergei Golubchik
8e8d42ddf0 Merge branch '10.0' into 10.1 2017-08-08 10:18:43 +02:00
Sergei Golubchik
f6bcdb9e3c test case for loadxml and spaces 2017-07-18 14:59:33 +02:00
Sergei Golubchik
fbdf18f86e MDEV-12696 Crash with LOAD XML and non-updatable VIEW column
extend the fix from 5.5 (in read_sep_field()) to apply to read_xml_field()
2017-05-09 00:28:43 +02:00
Shishir Jaiswal
ee02650bac Bug #16171518 - LOAD XML DOES NOT HANDLE EMPTY ELEMENTS
DESCRIPTION
===========
Inability of mysql LOAD XML command to handle empty XML
tags i.e. <row><tag/></row>. Also the behaviour is wrong
and (different than above) when there is a space in empty
tag i.e. <row><tag /></row>

ANALYSIS
========
In read_xml() the case where we encounter a close tag ('/')
we're decreasing the 'level' blindly which is wrong.
Actually when its an without-space-empty-tag (succeeding
char is '>'), we need to skip the decrement. In other words
whenever we hit a close tag ('/'), decrease the 'level'
only when (i) It's not an (without space) empty tag i.e.
<tag/> or, (ii) It is of format <row col="val" .../>

FIX
===
The switch case for '/' is modified. We've removed the
blind decrement of 'level'. We do it only when its not an
without-space-empty-tag. Also we are setting 'in_tag' to
false to let program know that we're done reading current
tag (required in the case of format <row col="val" .../>)
2015-08-18 12:24:27 +05:30
Alexander Barkov
25d31b8f7c Bug#51571 load xml infile causes server crash
Problem:
  item->name was NULL for Item_user_var_as_out_param
  which made strcmp(something, item->name) crash in the LOAD XML code.
  
  Fix:
  - item_func.h: Adding set_name() in constuctor for Item_user_var_as_out_param
  - sql_load.cc: Changing the condition in write_execute_load_query_log_event() which
  distiguished between Item_user_var_as_out_param and Item_field
  from
    if (item->name == NULL)
  to
    if (item->type() == Item::FIELD_ITEM)
  - loadxml.result, loadxml.test: adding tests
2010-05-05 14:34:20 +04:00
Alexey Botchkov
4e612a1c66 test updated 2009-11-11 21:30:51 +04:00
Alexey Botchkov
0503387ccc loadxml test update. 2009-11-11 05:42:02 +04:00
Alexey Botchkov
6d9aa9ea29 Bug#42520 killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
The additional patch. That 'loadxml.test' failure was actually about our testing system,
   not the code.
   Firstly we need a new mysqltest command, wich i called 'send_eval'. So the expression
   can be evaluated, then started in a parallel thread. We only have separane 'send' and
   'eval' commands at the moment.
   Then we need to add the waiting code after the 'KILL' to our test, so the thread will be killed
   before the test goes further. The present 'reap' command doesn't handle the killed threads
   well.
      
per-file comments:
  client/mysqltest.cc
Bug#42520      killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
    The 'send_eval' command implemented.

  mysql-test/r/loadxml.result
Bug#42520      killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
   test result updated.

  mysql-test/t/loadxml.test
Bug#42520      killing load .. infile Assertion failed: ! is_set(), file .\sql_error.cc, line 8
   test case added.
2009-11-11 00:55:05 +04:00
Alexander Barkov
583b853092 A postfix for backporting WL#1397 convert XML -> SQL
mysql-test/r/loadxml.result
mysql-test/t/loadxml.test
  Fixing non-deterministic test results

sql/sql_yacc.yy
  Initializing fname_first using get_tok_end() instead of get_ptr().
  The latter is grammar-dependant. The former is not.
2009-10-14 17:10:22 +05:00
Alexander Barkov
741a1df4cc WL#1397 convert XML -> SQL 2009-10-12 11:22:53 +05:00