summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | * Update wrong zip-code
* A cleanup in derived table handling: removing duplicate code from ↵Alexander Barkov2019-02-281-1/+1
| | | | | | | | | | | st_select_lex::handle_derived() st_select_lex::handle_derived() and mysql_handle_list_of_derived() had exactly the same implementations. - Adding a new method LEX::handle_list_of_derived() instead - Removing public function mysql_handle_list_of_derived() - Reusing LEX::handle_list_of_derived() in st_select_lex::handle_derived()
* MDEV-15950: LOAD DATA INTO compex_view crashedVarun Gupta2019-01-301-0/+5
| | | | | For multi-table views with LOAD, updates are not allowed, so we should just throw an error.
* MDEV-15744: Assertion `derived->table' failed in mysql_derived_merge_for_insertVarun Gupta2019-01-291-2/+3
| | | | | For singe-table views, we need to find the bottom most base table in the embedded views and then update that table
* MDEV-9619: Assertion `null_ref_table' failed in virtual table_map ↵Oleksandr Byelkin2017-10-131-5/+5
| | | | | | Item_direct_view_ref::used_tables() const on 2nd execution of PS Refer left expression indirectly in case it changes from execution to execution.
* Merge remote-tracking branch 'mysql/5.5' into 5.5Sergei Golubchik2017-07-181-1/+1
|\
| * Bug#16212207 - LOAD XML INFILE PERFORMANCE WITH INDENTEDShishir Jaiswal2017-05-231-1/+3
| | | | | | | | | | | | | | XML Post-push fix for build failure on Linux machine sles11-x86-64bit
| * Bug#16212207 - LOAD XML INFILE PERFORMANCE WITH INDENTEDShishir Jaiswal2017-05-161-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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()
* | Merge remote-tracking branch 'mysql/5.5' into 5.5mariadb-5.5.55Sergei Golubchik2017-04-111-39/+39
|\ \ | |/
| * Bug #24595937: INCORRECT BEHAVIOR WHEN LOADING DATA TO VIEWSreeharsha Ramanavarapu2016-12-131-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: ------ While using the LOAD statement to insert data into an updateable view, the check to verify whether a column is actually updatable is missing. Solution for 5.5 and 5.6: ------------------------- For a view whose column-list in specified in the LOAD command, this check is not performed. This fix adds the check. This is a partial backport of Bug#21097485. Solution for 5.7 and trunk: --------------------------- For a view whose column-list is specified in the LOAD command, this check is already performed. This fix adds the same check when no column-list is specified.
* | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-12-221-49/+28
|\ \ | |/
| * BUG#24487120 - SLAVE'S SLAVE_SQL_RUNNING IS STOPPED DURINGThayumanavar S2016-10-281-49/+28
| | | | | | | | | | | | | | | | | | | | LOAD DATA AT MASTER. Revert "BUG#23080148 - BACKPORT BUG 14653594 AND BUG 20683959 TO" This reverts commit 1d31f5b3090d129382b50b95512f2f79305715a1. The commit causes replication incompatibility between minor revisions and based on discussion with Srinivasarao, the patch is reverted.
* | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-08-031-28/+49
|\ \ | |/ | | | | without a fix for Bug#12818255 (MDEV-6581)
| * BUG#23080148 - BACKPORT BUG 14653594 AND BUG 20683959 TOThayumanavar S2016-06-201-28/+49
| | | | | | | | | | | | | | | | | | MYSQL-5.5 The bug asks for a backport of bug#1463594 and bug#20682959. This is required because of the fact that if replication is enabled, master transaction can commit whereas slave can't commit due to not exact 'enviroment'. This manifestation is seen in bug#22024200.
* | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-04-201-2/+3
|\ \ | |/
| * Bug #16912362 LOAD DATA INFILE CLAIMS TO BE HOLDINGAjo Robert2016-01-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'SYSTEM LOCK' IN PROCESSLIST Analysis ========= Show processlist shows 'System Lock' in 'State' field while LOAD DATA INFILE is running. thd->proc_info update is missing in LOAD DATA INFILE path. Thus any request will get last unpdated status from lock_table() during open_table(). Fix: ======= Update state information from LOAD DATA INFILE path.
* | Merge remote-tracking branch 'mysql/5.5' into 5.5Sergei Golubchik2015-10-081-3/+10
|\ \ | |/
| * Bug #16171518 - LOAD XML DOES NOT HANDLE EMPTY ELEMENTSShishir Jaiswal2015-08-181-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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" .../>)
| * Backport from trunk:Tor Didriksen2014-04-231-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#18396916 MAIN.OUTFILE_LOADDATA TEST FAILS ON ARM, AARCH64, PPC/PPC64 The recorded results for the failing tests were wrong. They were introduced by the patch for Bug#30946 mysqldump silently ignores --default-character-set when used with --tab Correct results were returned for platforms where 'char' is implemented as unsigned. This was reported as Bug#46895 Test "outfile_loaddata" fails (reproducible) Bug#11755168 46895: TEST "OUTFILE_LOADDATA" FAILS (REPRODUCIBLE) The patch for that bug fixed only parts of the problem, leaving the incorrect results in the .result file. Solution: use 'uchar' for field_terminator and line_terminator on all platforms. Also: remove some un-necessary casts, leaving the ones we actually need.
| * Bug#11759519 - INFINITE HANG WITH 100% CPU USAGE WITH LOAD DATAPraveenkumar Hulakund2014-03-191-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOCAL AND IMPORT ERRORS Description: ----------- This bug happens due to the fact that current algorithm is designed that in the case of LOCAL load of data, in case of the error, the remaining part of the file is read in order to return the proper error message to the client side. But, the problem with current implementation is that data stream for the client side is cleared only in the case where line delimiters exist, which is not a case with, for example fixed width fields. Fix: ---- Ported patch provided by Sinisa Milivojevic n bug report for this issue to 5.5+ versions. As part of this patch code is changed to clear the data stream by calling new member function "READ_INFO::skip_data_till_eof".
| * Bug#17429677:LAST ARGUMENT OF LOAD DATA ...SET ...STATEMENTSujatha Sivakumar2013-10-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REPEATED TWICE IN BINLOG Problem: ======= If LOAD DATA ... SET ... is used the last argument of SET is repeated twice in replication binlog. Analysis: ======== LOAD DATA statements are reconstructed once again before they are written to the binary log. When SET clauses are specified as part of LOAD DATA statement, these SET clause user command strings need to be stored in order to rebuild the original user command. During parsing each column and the value in the SET command are stored in two differenet lists. All the values are stored in a string list. When SET expression has more than one value as shown in the following example: SET a = @a, b = CONCAT(@b, '| 123456789'); Parser extracts values in the following manner i.e Item name , value string, actual length of the value of the item with in the string. Item a: Value for a:"= @a, b = CONCAT(@b, '| 123456789') str_length = 4 Item b: Value for b:"= CONCAT(@b, '| 123456789') str_length = 27 During reconstructing the LOAD DATA command the above strings are retrived as it is and appended to the LOAD DATA statement. Hence it becomes as shown below. SET `a`= @a, b = CONCAT(@b, '| 123456789'), `b`= CONCAT(@b, '| 123456789') Fix: === During reconstruction of SET command, retrieve exact item value string rather than reading the entire string.
| * Bug#16753869:INCORRECT TRUNCATION OF LONG SET EXPRESSION INSujatha Sivakumar2013-06-241-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOAD DATA CAN CAUSE SQL INJECTION Problem: ======= A long SET expression in LOAD DATA is incorrectly truncated when written to the binary log. Analysis: ======== LOAD DATA statements are reconstructed once again before they are written to the binary log. When SET clauses are specified as part of LOAD DATA statement, these SET clause user command strings need to be stored as it is inorder to reconstruct the original user command. At present these strings are stored as part of SET clause item tree's top most Item node's name itself which is incorrect. As an Item::name can be of MAX_ALIAS_NAME (256) size. Hence the name will get truncated to "255". Because of this the rewritten LOAD DATA statement will be terminated incorrectly. When this statment is read back by the mysqlbinlog tool it reads a starting single quote and continuos to read till it finds an ending quote. Hence any statement written post ending quote will be considered as a new statement. Fix: === As name field has length restriction the string value should not be stored in Item::name. A new String list is maintained to store the SET expression values and this list is read during reconstrution.
| * upmerge to bug#14548159Rohit Kalhans2012-09-221-19/+10
| |\
| | * BUG#14548159: NUMEROUS CASES OF INCORRECT IDENTIFIERRohit Kalhans2012-09-221-18/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QUOTING IN REPLICATION Problem: Misquoting or unquoted identifiers may lead to incorrect statements to be logged to the binary log. Fix: we use specialized functions to append quoted identifiers in the statements generated by the server.
| | * Merge from mysql-5.1.58-releaseKaren Langford2011-07-061-9/+9
| | |\
| | | * weave merge of mysql-5.1->mysql-5.1-securityGeorgi Kodinov2011-05-101-6/+5
| | | |\
| | * | \ Updated/added copyright headersKent Boortz2011-07-031-7/+6
| | |\ \ \ | | | | |/ | | | |/|
| * | | | Bug#12727287: Maintainer mode compilation fails with gcc 4.6Davi Arnaut2011-07-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.6 has new -Wunused-but-set-variable flag, which is enabled by -Wall, that causes GCC to emit a warning whenever a local variable is assigned to, but otherwise unused (aside from its declaration). Since the maintainer mode uses -Wall and -Werror, source code which triggers these warnings will be rejected. That is, these warnings become hard errors. The solution is to fix the code which triggers these specific warnings. In most of the cases, this is a welcome cleanup as code which triggers this warning is probably dead anyway.
| * | | | Merge from mysql-5.5.14-releasehery.ramilison@oracle.com2011-07-061-5/+5
| |\ \ \ \
| | * \ \ \ merged mysql-5.5->mysql-5.5-securityGeorgi Kodinov2011-06-061-3/+2
| | |\ \ \ \
| | * \ \ \ \ weave merge of mysql-5.5->mysql-5.5-securityGeorgi Kodinov2011-05-101-6/+5
| | |\ \ \ \ \
| | * \ \ \ \ \ merge mysql-5.1-security->mysql-5.5-securityGeorgi Kodinov2011-05-041-5/+5
| | |\ \ \ \ \ \ | | | | |_|_|_|/ | | | |/| | | |
| | | * | | | | Merged 5.0-security->5.1-securityGeorgi Kodinov2011-05-041-9/+9
| | | |\ \ \ \ \
| | | | * | | | | Bug #11764517: 57359: POSSIBLE TO CIRCUMVENT SECURE_FILE_PRIV Georgi Kodinov2011-04-281-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USING '..' ON WINDOWS Backport of the fix to 5.0 (to be null-merged to 5.1). Moved the test into the main test suite. Made mysql-test-run.pl to not use symlinks for sdtdata as the symlinks are now properly recognized by secure_file_priv. Made sure the paths in load_file(), LOAD DATA and SELECT .. INTO OUTFILE that are checked against secure_file_priv in a correct way similarly to 5.1 by the extended is_secure_file_path() backport before the comparison. Added an extensive test with all the variants of upper/lower case, slash/backslash and case sensitivity. Added few comments to the code.
| * | | | | | | | Updated/added copyright headersKent Boortz2011-07-041-1/+2
| |\ \ \ \ \ \ \ \ | | | |_|_|_|/ / / | | |/| | | | | |
| * | | | | | | | Updated/added copyright headersKent Boortz2011-06-301-2/+2
| |\ \ \ \ \ \ \ \ | | |/ / / / / / / | |/| | | | | / / | | | |_|_|_|/ / | | |/| | | | |
| | * | | | | | Updated/added copyright headersKent Boortz2011-06-301-2/+4
| | |\ \ \ \ \ \ | | | |_|/ / / / | | |/| | | | |
| | | * | | | | Updated/added copyright headersKent Boortz2011-06-301-2/+3
| | | | |/ / / | | | |/| | |
| * | | | | | auto-mergeTatjana Azundris Nuernberg2011-05-121-6/+5
| |\ \ \ \ \ \ | | | |_|_|/ / | | |/| | | |
| | * | | | | merge from 5.1Guilhem Bichot2011-04-261-5/+4
| | |\ \ \ \ \ | | | | |_|_|/ | | | |/| | |
| | | * | | | Fix for Bug#11765141 - "58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY WHEN ↵Guilhem Bichot2011-04-071-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ERROR OCCURS"
| | * | | | | 5.1 -> 5.5 mergeSergey Glukhov2011-04-151-1/+1
| | |\ \ \ \ \ | | | |/ / / / | | | | | | / | | | |_|_|/ | | |/| | |
| | | * | | Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS ↵Sergey Glukhov2011-04-151-1/+1
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AND WRITES WITH U Some multibyte sequences could be considered by my_mbcharlen() functions as multibyte character but more exact my_ismbchar() does not think so. In such a case this multibyte sequences is pushed into 'stack' buffer which is too small to accommodate the sequence. The fix is to allocate stack buffer in compliance with max character length.
| | | * | mergeGeorgi Kodinov2010-12-171-0/+7
| | | |\ \
| * | | \ \ auto-mergeTatjana Azundris Nuernberg2011-05-121-3/+2
| |\ \ \ \ \ | | |/ / / / | |/| | | |
| | * | | | Bug#11902767/Bug#60580: Statement improperly replicated crashes slave SQL threadTatjana Azundris Nuernberg2011-05-121-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If LOAD DATA INFILE featured a SET clause, the name=value pairs would be regenerated using item::print. Unfortunately, that code is mostly optimized for EXPLAIN EXTENDED output and such, and can not be relied on to return valid SQL. We now name each value its original, user-supplied form and use that to create LOAD DATA INFILE statements for statement-based replication.
| * | | | | bug#59085 recommitMattias Jonsson2011-02-101-4/+3
| | | | | |
| * | | | | BUG#59267 LOAD DATA LOCAL INFILE not executed on slave with SBRAlfranio Correia2011-01-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On windows, an #endif in a wrong place was causing an early return from mysql_load and thus the LOAD DATA LOCAL was not executed. This problem was fixed by moving the #endif to the right place. The following code was missing if ((stat_info.st_mode & S_IFIFO) == S_IFIFO) is_fifo = 1; which is required to properly configure and read from the IO_CACHE when a named pipe is used. So it was re-introduced before the #endif.
| * | | | | mergeGeorgi Kodinov2010-12-171-0/+7
| |\ \ \ \ \ | | |/ / / /
| | * | | | BUG#46166Luis Soares2010-12-071-0/+7
| | |\ \ \ \ | | | | |/ / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manual merge from mysql-5.1-bugteam into mysql-5.5-bugteam. Conflicts ========= Text conflict in sql/log.cc Text conflict in sql/log.h Text conflict in sql/slave.cc Text conflict in sql/sql_parse.cc Text conflict in sql/sql_priv.h