summaryrefslogtreecommitdiff
path: root/sql/item_xmlfunc.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1bar@bar.myoffice.izhnet.ru2007-10-301-36/+24
|\ | | | | | | into mysql.com:/home/bar/mysql-work/mysql-5.1-new-rpl-merge
| * Bug#27287 extractvalue() (and updatexml()) extremely slow for large XMLbar@mysql.com/bar.myoffice.izhnet.ru2007-10-091-36/+24
| | | | | | | | | | | | Performance improvements made. ExtractValue for large XML values is now much faster (about 2000 times faster of 1Mb-long XML values).
* | Fix for bug #31438: updatexml still crashesramil/ram@mysql.com/ramil.myoffice.izhnet.ru2007-10-081-1/+2
|/ | | | | | Problem: check missed if the second updatexml() argument is valid. Fix: check it.
* Fixed a lot of compiler warnings and errors detected by Forte C++ on Solarismonty@mysql.com/nosik.monty.fi2007-08-131-7/+13
| | | | | | | | | | | | Faster thr_alarm() Added 'Opened_files' status variable to track calls to my_open() Don't give warnings when running mysql_install_db Added option --source-install to mysql_install_db I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems index_read() -> index_read_map() index_read_idx() -> index_read_idx_map() index_read_last() -> index_read_last_map()
* Fixes Bug#30127: --debug-info no longer prints memory usage in mysqlmonty@mysql.com/nosik.monty.fi2007-08-011-2/+2
| | | | | | | Fixed compiler warnings, errors and link errors Fixed new bug on Solaris with gethrtime() Added --debug-check option to all mysql clients to print errors and memory leaks Added --debug-info to all clients. This now works as --debug-check but also prints memory and cpu usage
* Slow query log to file now displays queries with microsecond precissionmonty@mysql.com/nosik.monty.fi2007-07-301-1/+1
| | | | | | | | | | | | | | | | | --long-query-time is now given in seconds with microseconds as decimals --min_examined_row_limit added for slow query log long_query_time user variable is now double with 6 decimals Added functions to get time in microseconds Added faster time() functions for system that has gethrtime() (Solaris) We now do less time() calls. Added field->in_read_set() and field->in_write_set() for easier field manipulation by handlers set_var.cc and my_getopt() can now handle DOUBLE variables. All time() calls changed to my_time() my_time() now does retry's if time() call fails. Added debug function for stopping in mysql_admin_table() when tables are locked Some trivial function and struct variable renames to avoid merge errors. Fixed compiler warnings Initialization of some time variables on windows moved to my_init()
* Merge bk-internal.mysql.com:/home/bk/mysql-5.1kostja@bodhi.(none)2007-06-011-4/+4
|\ | | | | | | into bodhi.(none):/opt/local/work/mysql-5.1-runtime
| * WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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
* | Bug#28558 UpdateXML called with garbage crashes serverbar@mysql.com/bar.myoffice.izhnet.ru2007-05-231-7/+5
| | | | | | | | | | | | | | | | Problem: Memory overrun happened in attempts to generate error messages (e.g. in case of incorrect XPath syntax). Reason: set_if_bigger() was used instead of set_if_smaller(). Change: replacing wrong set_if_bigger() to set_if_smaller(), and making minor additional code clean-ups.
* | Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-rplbar@bar.myoffice.izhnet.ru2007-05-081-9/+66
|\ \ | | | | | | | | | into mysql.com:/home/bar/mysql-5.1.b26518
| * | Bug#26518 XPath and variables problembar@mysql.com/bar.myoffice.izhnet.ru2007-05-081-9/+66
| |/ | | | | | | | | | | Problem: XPath variables didn't work. Fix: adding variables support, both user-defined and sp local variables are now supported by XPath.
* | Bug#27898 UPDATEXML Crashes the Server!bar@mysql.com2007-05-021-0/+10
|/ | | | | | | | Problem: when replacing the root element, UpdateXML erroneously tried to mix old XML content with the replacement string, which led to crash. Fix: don't use the old XML content in these cases, just return the replacement string.
* Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.1-new-rpllars/lthalmann@dl145h.mysql.com2007-02-241-16/+76
|\ | | | | | | into mysql.com:/nfsdisk1/lars/MERGE/mysql-5.1-merge
| * Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-rplbar@bar.myoffice.izhnet.ru2007-01-221-16/+76
| |\ | | | | | | | | | into mysql.com:/home/bar/mysql-5.1.b24747
| | * Bug#24747 XPath error with the node name "Text"bar@mysql.com2006-12-271-16/+76
| | |
* | | After merge fixesmonty@mysql.com/narttu.mysql.fi2007-01-291-4/+0
|/ / | | | | | | | | | | | | Removed a lot of compiler warnings Removed not used variables, functions and labels Initialize some variables that could be used unitialized (fatal bugs) %ll -> %l
* | Many files:kent@mysql.com/kent-amd64.(none)2006-12-311-3/+2
| | | | | | | | | | | | | | | | | | | | Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header Adjusted year(s) in copyright header Added GPL copyright text my_vle.h, rpl_utility.h, my_vle.c, base64-t.c, rpl_utility.cc: Changed copyright header formatting some plugin_example.c, daemon_example.c: Added "Copyright (C) 2006 MySQL AB" to GPL header
* | Many files:kent@mysql.com/kent-amd64.(none)2006-12-271-2/+1
|/ | | | Changed header to GPL version 2 only
* Fixed compiler warnings (Mostly VC++):monty@mysql.com/narttu.mysql.fi2006-11-301-1/+1
| | | | | | | | | | | | | - Removed not used variables - Changed some ulong parameters/variables to ulonglong (possible serious bug) - Added casts to get rid of safe assignment from longlong to long (and similar) - Added casts to function parameters - Fixed signed/unsigned compares - Added some constructores to structures - Removed some not portable constructs Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown" (Added new parameter to net_clear() to define when we want the communication buffer to be emptied)
* Bug#22823 gt and lt operators appear to be reversed in ExtractValue() commandbar@mysql.com/bar.intranet.mysql.r18.ru2006-10-231-8/+8
| | | | | Problem: "greater than" and "less than" XPath operators appeared to have been implemented in reverse. Fix: swap arguments to eq_func() and eq_func_reverse() to provide correct operation result.
* Bug#20854 XML functions: wrong result in ExtractValuebar@mysql.com/bar.intranet.mysql.r18.ru2006-09-141-6/+58
|
* Bug#20795: extractvalue() won't accept names containing a dot (.)bar@mysql.com/bar.intranet.mysql.r18.ru2006-07-251-1/+2
| | | | Dot character was not considered as a valid identifier body character.
* Post-merge fixes.kostja@bodhi.local2006-07-141-1/+1
|
* Merge mysql.com:/usr/home/bar/mysql-5.1-new.b18201bar@bar.intranet.mysql.r18.ru2006-06-191-1/+11
|\ | | | | | | into mysql.com:/usr/home/bar/mysql-5.1-kt
| * Merge mysql.com:/usr/home/bar/mysql-5.1-newbar@mysql.com2006-05-021-1/+11
| |\ | | | | | | | | | into mysql.com:/usr/home/bar/mysql-5.1-new.b18201
| | * Bug#18201: XML: ExtractValue works even if the xmlbar@mysql.com2006-04-171-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge mysql.com:/usr/home/bar/mysql-5.1-newbar@mysql.com2006-05-031-1/+25
|\ \ \ | |/ / |/| | | | | into mysql.com:/usr/home/bar/mysql-5.1-new.b18170
| * | Bug#18170: XML: ExtractValue(): XPath expression can't use QNames (colon in ↵bar@mysql.com2006-04-171-1/+25
| |/ | | | | | | | | | | | | | | | | | | | | | | names) Problem source: Qualified names (aka QName) didn't work as tag names and attribute names, because the parser lacked a real rule to scan QName, so it understood only non-qualified names without prefixes. Solution: New rule was added to check both "ident" and "ident:ident" sequences.
* | item_xmlfunc.cc:bar@mysql.com2006-04-191-3/+1
| | | | | | | | | | After review minor fixes for bug#16319 Thanks to Gluh for suggestions.
* | Merge mysql.com:/usr/home/bar/mysql-5.1-newbar@mysql.com2006-04-141-1/+17
|\ \ | |/ |/| | | into mysql.com:/usr/home/bar/mysql-5.1-new.b16319
| * Bug#16319: XML: extractvalue() returns syntax errors for some functionsbar@mysql.com2006-04-071-1/+17
| |
* | Bug#16233: XML: ExtractValue() fails with special charactersbar@mysql.com2006-04-111-38/+26
|/ | | | | | | | | | ExtractValue didn't understand tag and attribute names consisting of "tricky" national letters (e.g. latin accenter letters). It happened because XPath lex parser recognized only basic latin letter a..z ad a part of an identifier. Fixed to recognize all letters by means of new "full ctype" which was added recently.
* Fixed compiler and valgrind warningsmonty@mysql.com2006-03-291-2/+1
| | | | | | | | | | Added missing DBUG_xxx_RETURN statements Fixed some usage of not initialized variables (as found by valgrind) Ensure that we don't remove locked tables used as name locks from open table cache until unlock_table_names() are called. This was fixed by having drop_locked_name() returning any table used as a name lock so that we can free it in unlock_table_names() This will allow Tomas to continue with his work to use namelocks to syncronize things. Note: valgrind still produces a lot of warnings about using not initialized code and shows memory loss errors when running the ndb tests
* item_xmlfunc.cc:bar@mysql.com2006-03-221-7/+2
| | | | | | After review fix. Thanks to Gluh for suggestion. Bug#18172: XML: Extractvalue() accepts mallformed XPath without a XPath syntax error
* Bug #18172 XML: Extractvalue() accepts mallformedbar@mysql.com2006-03-201-1/+4
| | | | | | | | | | | | | | | | | | | XPath without a XPath syntax error item_xmlfunc.cc: Error message didn't happen because after a failing attempt to parse RelativeLocationPath, my_xpath_parse_AbsoluteLocationPath() returned success. Changeing logic a bit: - Try to parse EOF first, return success if true. - Then try to parse RelativeLocationPath(), return success if true. - Otherwise return failure. xml.result: Adding test case. Also, this change made it possible to generate an error message earlier in the case of another bad XPATH syntax. xml.test: Adding test case.
* xml.result, xml.test:bar@mysql.com2006-03-151-2/+4
| | | | | | | Adding test. item_xmlfunc.cc: Bug #18171 XML: ExtractValue: the XPath position() function crashes the server! Disallowing use of position() and last() without context.
* Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-new/bar@mysql.com2006-03-091-12/+29
|\ | | | | | | into mysql.com:/usr/home/bar/mysql-5.1-new.b16318
| * Bug#16318: XML: extractvalue() incorrectly returns last() = 1bar@mysql.com2006-03-031-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | xml.result, xml.test: Adding test case. item_xmlfunc.cc: - adding "size" member into MY_XPATH_FLT struct, to pass parent's context size when iterating in a predicate. Previously, temporaty context size was calculated instead, which is always 1. As a result, things like last() and count() didn't work fine. - adding iteration into Item_func_xpath_elementbyindex: similar to Item_func_xpath_predicate. This is to make things like last() and count() work inside square brackets.
* | Bug#16316: XML: extractvalue() is case-sensitive with contains()bar@mysql.com2006-03-021-1/+6
|/ | | | | | | | | xml.result, xml.test: Adding test case. item_xmlfunc.cc: Fixed that Item_nodeset_func derived classes didn't take into account charset of the XML value and always worked using "binary" charset.
* Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-newbar@mysql.com2006-03-021-0/+29
|\ | | | | | | into mysql.com:/usr/home/bar/mysql-5.1-new.16315
| * Bug#16315 XML: extractvalue() handles self badlybar@mysql.com2006-03-011-0/+29
| | | | | | | | | | | | | | | | xml.result, xml.test: Adding test case. item_xmlfunc.cc: Adding a special function to handle "self" axis. Previously "child" and "self" were handled the same.
* | Bug#16320 XML: extractvalue() won't accept names containing underscoresgluh@eagle.intranet.mysql.r18.ru2006-03-011-1/+1
|/ | | | added '_' to allowed tag body symbols
* Bug#16313 XML: extractvalue() ignores '!' in namesbar@mysql.com2006-02-281-2/+11
| | | | | | | | | | | | | | | | | xml.result, xml.test: Adding test case. item_xmlfunc.cc: Fixed that the "!" character written at the end was ignored. Now if we try to scan "!=", and if "!" is not followed by "=", we rollback lex scanner back to "!" token, so the parser will start to check the next rule from the "!" character again. Previously parser started from the next character, which was EOF in the example in xml.test, which led to query being successfully parsed, instead of producing a syntax error.
* Bug#16234 XML: Crash if ExtractValue()bar@mysql.com2006-02-101-1/+6
| | | | | | | | | Also fixes 16314: XML: extractvalue() crash if vertical bar xml.result, xml.test: Adding test case item_xmlfunc.cc: Using root element as a context node, instead of NULL, with relative paths.
* Fix -ansi -pedantic compilekonstantin@mysql.com2006-01-051-1/+1
|
* Adding XPath support: ExtractValue and UpdateXML functions.bar@mysql.com2005-12-211-0/+2572
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