summaryrefslogtreecommitdiff
path: root/strings/xml.c
Commit message (Collapse)AuthorAgeFilesLines
* Bug#11766725 (Bug#59901) EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332Alexander Barkov2011-03-011-1/+6
| | | | | | | | | | | | | | | | | Problem: a byte behind the end of input string was read in case of a broken XML not having a quote or doublequote character closing a string value. Fix: changing condition not to read behind the end of input string @ mysql-test/r/xml.result @ mysql-test/t/xml.test Adding tests @ strings/xml.c When checking if the closing quote/doublequote was found, using p->cur[0] us unsafe, as p->cur can point to the byte after the value. Comparing p->cur to p->beg instead.
* Updating Copyright informationAlexander Barkov2011-01-191-1/+1
|
* Bug#44332 my_xml_scan reads behind the end of bufferAlexander Barkov2011-01-181-6/+17
| | | | | | | | | | | | | | | | Problem: the scanner function tested for strings "<![CDATA[" and "-->" without checking input string boundaries, which led to valgrind's "Conditional jump or move depends on uninitialised value(s)" error. Fix: Adding boundary checking. @ mysql-test/r/xml.result @ mysql-test/t/xml.test Adding test @ strings/xml.c Adding a helper function my_xml_parser_prefix_cmp(), with input string boundary check.
* Bug#53445: Build with -Wall and fix warnings that it generatesDavi Arnaut2010-07-021-4/+4
| | | | | | | | | | | | | | | | Apart strict-aliasing warnings, fix the remaining warnings generated by GCC 4.4.4 -Wall and -Wextra flags. One major source of warnings was the in-house function my_bcmp which (unconventionally) took pointers to unsigned characters as the byte sequences to be compared. Since my_bcmp and bcmp are deprecated functions whose only difference with memcmp is the return value, every use of the function is replaced with memcmp as the special return value wasn't actually being used by any caller. There were also various other warnings, mostly due to type mismatches, missing return values, missing prototypes, dead code (unreachable) and ignored return values.
* Bug#38227 EXTRACTVALUE doesn't work with DTD declarationsAlexander Barkov2008-12-101-2/+11
| | | | | | | | | | | Problem: XML syntax parser allowed to use quoted strings as attribute names, and tried to put them into parser state stack instead of identifiers. After that parser failed, if quoted string contained some slash characters. Fix: - Disallowing quoted strings in regular tags. - Allowing quoted string in DOCTYPE declararion, but don't push it into parse state stack (just skip it).
* WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-27/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (first part) The following type conversions was done: - Changed byte to uchar - Changed gptr to uchar* - Change my_string to char * - Change my_size_t to size_t - Change size_s to size_t Removed declaration of byte, gptr, my_string, my_size_t and size_s. Following function parameter changes was done: - All string functions in mysys/strings was changed to use size_t instead of uint for string lengths. - All read()/write() functions changed to use size_t (including vio). - All protocoll functions changed to use size_t instead of uint - Functions that used a pointer to a string length was changed to use size_t* - Changed malloc(), free() and related functions from using gptr to use void * as this requires fewer casts in the code and is more in line with how the standard functions work. - Added extra length argument to dirname_part() to return the length of the created string. - Changed (at least) following functions to take uchar* as argument: - db_dump() - my_net_write() - net_write_command() - net_store_data() - DBUG_DUMP() - decimal2bin() & bin2decimal() - Changed my_compress() and my_uncompress() to use size_t. Changed one argument to my_uncompress() from a pointer to a value as we only return one value (makes function easier to use). - Changed type of 'pack_data' argument to packfrm() to avoid casts. - Changed in readfrm() and writefrom(), ha_discover and handler::discover() the type for argument 'frmdata' to uchar** to avoid casts. - Changed most Field functions to use uchar* instead of char* (reduced a lot of casts). - Changed field->val_xxx(xxx, new_ptr) to take const pointers. Other changes: - Removed a lot of not needed casts - Added a few new cast required by other changes - Added some cast to my_multi_malloc() arguments for safety (as string lengths needs to be uint, not size_t). - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done explicitely as this conflict was often hided by casting the function to hash_get_key). - Changed some buffers to memory regions to uchar* to avoid casts. - Changed some string lengths from uint to size_t. - Changed field->ptr to be uchar* instead of char*. This allowed us to get rid of a lot of casts. - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar - Include zlib.h in some files as we needed declaration of crc32() - Changed MY_FILE_ERROR to be (size_t) -1. - Changed many variables to hold the result of my_read() / my_write() to be size_t. This was needed to properly detect errors (which are returned as (size_t) -1). - Removed some very old VMS code - Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix) - Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe. Updated function comment to reflect this. Changed function that depended on original behavior of my_pwrite() to itself restore the cursor position (one such case). - Added some missing checking of return value of malloc(). - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow. - Changed type of table_def::m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length. - Moved THD::max_row_length() to table.cc (as it's not depending on THD). Inlined max_row_length_blob() into this function. - More function comments - Fixed some compiler warnings when compiled without partitions. - Removed setting of LEX_STRING() arguments in declaration (portability fix). - Some trivial indentation/variable name changes. - Some trivial code simplifications: - Replaced some calls to alloc_root + memcpy to use strmake_root()/strdup_root(). - Changed some calls from memdup() to strmake() (Safety fix) - Simpler loops in client-simple.c
* Merge mysql.com:/home/kent/bk/main/mysql-5.0kent@kent-amd64.(none)2006-12-231-2/+1
|\ | | | | | | into mysql.com:/home/kent/bk/main/mysql-5.1
| * Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | | | | | Changed header to GPL version 2 only
* | Bug#20854 XML functions: wrong result in ExtractValuebar@mysql.com/bar.intranet.mysql.r18.ru2006-09-141-9/+51
| |
* | Bug#20795: extractvalue() won't accept names containing a dot (.)bar@mysql.com/bar.intranet.mysql.r18.ru2006-07-251-4/+4
| | | | | | | | Dot character was not considered as a valid identifier body character.
* | Bug#18201: XML: ExtractValue works even if the xmlbar@mysql.com2006-04-171-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | fragment is not well-formed xml Problem: - ExtractValue silently returned NULL if a wrong XML value is passed. - In some cases "unexpected END-OF-INPUT" error was not detected, and a non-NULL result could be returned for a bad XML value. Fix: - Adding warning messages, to make user aware why NULL was returned. - Missing "unexpected END-OF-INPUT" error is reported now.
* | Bug#18285: ExtractValue not returning character data within <![CDATA[]]> as ↵bar@mysql.com2006-04-071-0/+22
| | | | | | | | expected
* | Adding XPath support: ExtractValue and UpdateXML functions.bar@mysql.com2005-12-211-5/+16
|/ | | | | | | | | | | | | | | | | | | | | | libmysqld/Makefile.am: sql/Makefile.am: Adding new source files. Adding new file into build process. include/my_xml.h: strings/xml.c: Adding new XML parse flags to skip text normalization and to use relative tag names. Adding enum for XML token types. sql/lex.h: Making parser aware of new SQL functions. sqll/item_create.h, sql/item_create.cc: Adding creators for ExtractValue and UpdateXML. sql/item.h: Adding new Item types: nodeset and nodeset comparator. sql/item_xmlfunc.h sql/item_xmlfunc.cc Adding new classes implementing XPath functions. mysql-test/t/xml.test, mysql-test/r/xml.result: New files: adding test case
* Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-tmpjani@ua141d10.elisa.omakaista.fi2005-10-131-1/+1
|\ | | | | | | into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0
| * Fix read past allocated buffer when parsing charsets file. (Bug #6413)jimw@mysql.com2005-10-111-1/+1
| |
* | Fixes during review of new codemonty@mysql.com2005-07-041-33/+34
| | | | | | | | | | | | | | | | - Mostly indentation fixes - Added missing test - Ensure that Item_func_case() checks for stack overruns - Use real_item() instead of (Item_ref*) item - Fixed wrong error handling
* | fixes for windows 64-bit compiler warningsgeorg@lmy002.wdf.sap.corp2005-06-131-12/+12
| |
* | After merge fixesmonty@mysql.com2004-12-311-1/+1
|/
* Review of all code pushed since last reviewmonty@mishka.local2004-10-201-3/+4
| | | | | | | Simple optimzations and cleanups Removed compiler warnings and fixed portability issues Added client functions 'mysql_embedded()' to allow client to check if we are using embedded server Fixes for purify
* xml.c:bar@bar.mysql.r18.ru2003-09-221-1/+1
| | | | Bug fix
* Portability fixesmonty@narttu.mysql.fi2003-02-281-9/+34
|
* xml.c:bar@bar.mysql.r18.ru2003-01-101-0/+374
new file