summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
Commit message (Collapse)AuthorAgeFilesLines
* Updated/added copyright headersKent Boortz2011-06-301-2/+4
|\
| * Updated/added copyright headersKent Boortz2011-06-301-2/+3
| |
* | mergeGeorgi Kodinov2010-12-171-0/+7
|\ \
| * | BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error Luis Soares2010-11-301-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when generating new name. If find_uniq_filename returns an error, then this error is not being propagated upwards, and execution does not report error to the user (although a entry in the error log is generated). Additionally, some more errors were ignored in new_file_impl: - when writing the rotate event - when reopening the index and binary log file This patch addresses this by propagating the error up in the execution stack. Furthermore, when rotation of the binary log fails, an incident event is written, because there may be a chance that some changes for a given statement, were not properly logged. For example, in SBR, LOAD DATA INFILE statement requires more than one event to be logged, should rotation fail while logging part of the LOAD DATA events, then the logged data would become inconsistent with the data in the storage engine.
* | | Bug58747 57359 patch: breaks secure_file_priv+not secure yet+still accesses ↵Kristofer Pettersson2010-12-161-42/+43
|/ / | | | | | | | | | | | | | | | | other folders "load data infile .." allowed for access to unautohorized tables. Due to a faulty if-statement it was possible to circumvent the secure_file_priv restriction.
* | Bug #56709: Memory leaks at running the 5.1 test suiteAlexey Kopytov2010-09-221-7/+5
| | | | | | Fixed a number of memory leaks discovered by valgrind.
* | Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains ↵2010-08-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | load data infile With statement- or mixed-mode logging, "LOAD DATA INFILE" queries are written to the binlog using special types of log events. When mysqlbinlog reads such events, it re-creates the file in a temporary directory with a generated filename and outputs a "LOAD DATA INFILE" query where the filename is replaced by the generated file. The temporary file is not deleted by mysqlbinlog after termination. To fix the problem, in mixed mode we go to row-based. In SBR, we document it to remind user the tmpfile is left in a temporary directory.
* | Revert patch for BUG#34283. Causing lots of test failures in PB2,Luis Soares2010-07-301-8/+0
| | | | | | mostly because existing test result files were not updated.
* | Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains ↵2010-07-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | load data infile With statement- or mixed-mode logging, "LOAD DATA INFILE" queries are written to the binlog using special types of log events. When mysqlbinlog reads such events, it re-creates the file in a temporary directory with a generated filename and outputs a "LOAD DATA INFILE" query where the filename is replaced by the generated file. The temporary file is not deleted by mysqlbinlog after termination. To fix the problem, in mixed mode we go to row-based. In SBR, we document it to remind user the tmpfile is left in a temporary directory.
* | Bug#45288: pb2 returns a lot of compilation warnings on linuxDavi Arnaut2010-07-201-7/+6
| | | | | | | | | | | | Fix warnings flagged by the new warning option -Wunused-but-set-variable that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The option causes a warning whenever a local variable is assigned to but is later unused. It also warns about meaningless pointer dereferences.
* | Bug #51876: crash/memory underrun when loading data with ucs2Georgi Kodinov2010-07-141-23/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and reverse() function 3 problems fixed : 1. The reported problem : caused by incorrect parsing of the file as ucs data resulting in wrong length of the parsed string. Fixed by truncating the invalid trailing bytes (non-complete multibyte characters) when reading from the file 2. LOAD DATA when reading from a proper UCS2 file wasn't recognizing the new line characters. Fixed by first looking if a byte is a new line (or any other special) character before reading it as a part of a multibyte character. 3. When using user variables to hold the column data in LOAD DATA the character set of the user variable was set incorrectly to the database charset. Fixed by setting it to the charset specified by LOAD DATA (if any).
* | MergeGeorgi Kodinov2010-06-091-0/+4
|\ \
| * | Bug #52512: Assertion `! is_set()' in Diagnostics_area::set_ok_status Georgi Kodinov2010-04-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on LOAD DATA Two problems : 1. LOAD DATA was not checking for SQL errors and was sending an OK packet even when there were errors reported already. Fixed to check for SQL errors in addition to the error conditions already detected. 2. There was an over-ambitious assert() on the server to check if the protocol is always followed by the client. This can cause crashes on debug servers by clients not completing the protocol exchange for some reason (e.g. --send command in mysqltest). Fixed by keeping the assert only on client side, since the server always completes the protocol exchange.
* | | Bug#53189 Table map version unused and can be removedHe Zhenxing2010-05-081-2/+0
| | | | | | | | | | | | | | | MYSQL_BIN_LOG m_table_map_version member and it's associated functions were not used in the logic of binlogging and replication, this patch removed all related code.
* | | Bug#50373 --secure-file-priv=""Kristofer Pettersson2010-05-031-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Iterative patch improvement. Previously committed patch caused wrong result on Windows. The previous patch also broke secure_file_priv for symlinks since not all file paths which must be compared against this variable are normalized using the same norm. The server variable opt_secure_file_priv wasn't normalized properly and caused the operations LOAD DATA INFILE .. INTO TABLE .. and SELECT load_file(..) to do different interpretations of the --secure-file-priv option. The patch moves code to the server initialization routines so that the path always is normalized once and only once. It was also intended that setting the option to an empty string should be equal to lifting all previously set restrictions. This is also fixed by this patch.
* | | AutomergeKristofer Pettersson2010-04-161-5/+3
|\ \ \ | |/ /
| * | Bug#51377 Crash in information_schema / processlist on concurrent DDL ↵Alexey Botchkov2010-03-091-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | workload the fill_schema_processlist function accesses THD::query() without proper protection so the parallel thread killing can lead to access to the freed meemory. per-file comments: sql/sql_load.cc Bug#51377 Crash in information_schema / processlist on concurrent DDL workload the THD::set_query_inner() call needs to be protected. But here we don't need to change the original thd->query() at all. sql/sql_show.cc Bug#51377 Crash in information_schema / processlist on concurrent DDL workload protect the THD::query() access with the THD::LOCK_thd_data mutex.
* | | Bug#50373 --secure-file-priv=""Kristofer Pettersson2010-04-161-3/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The server variable opt_secure_file_priv wasn't normalized properly and caused the operations LOAD DATA INFILE .. INTO TABLE .. and SELECT load_file(..) to do different interpretations of the --secure-file-priv option. The patch moves code to the server initialization routines so that the path always is normalized once and only once. It was also intended that setting the option to an empty string should be equal to lifting all previously set restrictions. This is also fixed by this patch.
* | Backport Bug#37148 to 5.1He Zhenxing2010-01-241-14/+18
| |
* | BUG#49479: Slave stops with syntax error: LOAD DATA event without Luis Soares2009-12-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | escaped field names When in mixed or statement mode, the master logs LOAD DATA queries by resorting to an Execute_load_query_log_event. This event does not contain the original query, but a rewritten version of it, which includes the table field names. However, the rewrite does not escape the field names. If these names match a reserved keyword, then the slave will stop with a syntax error when executing the event. We fix this by escaping the fields names as it happens already for the table name.
* | Bug #43913 rpl_cross_version can't pass on conflicts complainig clash with ↵2009-11-281-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --slave-load-tm The 'slave_patternload_file' is assigned to the real path of the load data file when initializing the object of Relay_log_info. But the path of the load data file is not formatted to real path when executing event from relay log. So the error will be encountered if the path of the load data file is a symbolic link. Actually the global 'opt_secure_file_priv' is not formatted to real path when loading data from file. So the same thing will happen too. To fix these errors, the path of the load data file should be formatted to real path when executing event from relay log. And the 'opt_secure_file_priv' should be formatted to real path when loading data infile.
* | BUG#48297: Schema name is ignored when LOAD DATA is written into Luis Soares2009-10-271-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | binlog, replication aborts In SBR or MBR, the schema name is not being written to the binlog when executing a LOAD DATA statement. This becomes a problem when the current database (lets call it db1) is different from the table's schema (lets call it db2). For instance, take the following statements: use db1; load data local infile 'infile.txt' into table db2.t Should this statement be logged without t's schema (db2), when replaying it, one can get db1.t populated instead of db2.t (if db1.t exists). On the other hand, if there is no db1.t at all, replication will stop. We fix this by always logging the table (in load file) with fully qualified name when its schema is different from the current database or when no default database was selected.
* | Bug #40877: multi statement execution fails in 5.1.30Georgi Kodinov2009-10-161-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented the server infrastructure for the fix: 1. Added a function LEX_STRING *thd_query_string(THD) to return a LEX_STRING structure instead of char *. This is the function that must be called in innodb instead of thd_query() 2. Did some encapsulation in THD : aggregated thd_query and thd_query_length into a LEX_STRING and made accessor and mutator methods for easy code updating. 3. Updated the server code to use the new methods where applicable.
* | Bug#43746: YACC return wrong query string when parse 'load data infile' sql ↵Tatiana A. Nurnberg2009-09-281-13/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | statement "load data" statements were written to the binlog as a mix of the original statement and bits recreated from parse-info. This relied on implementation details and broke with IGNORE_SPACES and versioned comments. We now completely resynthesize the query for LOAD DATA for binlog (which among other things normalizes them somewhat with regard to case, spaces, etc.). We have already parsed the query properly, so we make use of that rather than mix-and-match string literals and parsed items. This should make us safe with regard to versioned comments, even those spanning multiple tokens. Also no longer affected by IGNORE_SPACES.
* | Bug# 30946: mysqldump silently ignores --default-character-setGleb Shchepa2009-07-311-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when used with --tab 1) New syntax: added CHARACTER SET clause to the SELECT ... INTO OUTFILE (to complement the same clause in LOAD DATA INFILE). mysqldump is updated to use this in --tab mode. 2) ESCAPED BY/ENCLOSED BY field parameters are documented as accepting CHAR argument, however SELECT .. INTO OUTFILE silently ignored rests of multisymbol arguments. For the symmetrical behavior with LOAD DATA INFILE the server has been modified to fail with the same error: ERROR 42000: Field separator argument is not what is expected; check the manual 3) Current LOAD DATA INFILE recognizes field/line separators "as is" without converting from client charset to data file charset. So, it is supposed, that input file of LOAD DATA INFILE consists of data in one charset and separators in other charset. For the compatibility with that [buggy] behaviour SELECT INTO OUTFILE implementation has been saved "as is" too, but the new warning message has been added: Non-ASCII separator arguments are not fully supported This message warns on field/line separators that contain non-ASCII symbols.
| |
| \
*-. \ Merge from 5.0-bugteamStaale Smedseng2009-06-171-4/+4
|\ \ \ | | |/
| | * Bug #43414 Parenthesis (and other) warnings compiling MySQL Staale Smedseng2009-06-171-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 Compiling MySQL with gcc 4.3.2 and later produces a number of warnings, many of which are new with the recent compiler versions. This bug will be resolved in more than one patch to limit the size of changesets. This is the second patch, fixing more of the warnings.
| * | Bug #43414 Parenthesis (and other) warnings compiling MySQL Staale Smedseng2009-06-101-4/+4
| |/ | | | | | | | | | | | | | | | | | | | | with gcc 4.3.2 Compiling MySQL with gcc 4.3.2 and later produces a number of warnings, many of which are new with the recent compiler versions. This bug will be resolved in more than one patch to limit the size of changesets. This is the second patch, fixing more of the warnings.
* | BUG#41948 Query_log_event constructor needlessly contortedHe Zhenxing2009-05-301-5/+8
| | | | | | | | | | Make the caller of Query_log_event, Execute_load_log_event constructors and THD::binlog_query to provide the error code instead of having the constructors to figure out the error code.
* | auto-mergeIgnacio Galarza2009-03-171-3/+26
|\ \
| * | BUG#38174 secure-file-priv breaks LOAD DATA INFILE replication in statement modeAlfranio Correia2009-02-211-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | If secure-file-priv was set on slave, it became unable to execute LOAD DATA INFILE statements sent from master using mixed or statement-based replication. This patch fixes the issue by ignoring this security restriction and checking if the files are created and read by the slave in the --slave-load-tmpdir while executing the SQL Thread.
* | | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-131-2/+2
|\ \ \ | |/ / |/| / | |/ | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
| * Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-101-2/+2
| | | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
* | auto-mergeTatiana A. Nurnberg2008-09-171-1/+3
|\ \ | |/
| * Bug#37114: sql_mode NO_BACKSLASH_ESCAPES does not work properly with LOAD ↵Tatiana A. Nurnberg2008-09-171-1/+3
| | | | | | | | | | | | DATA INFILE NO_BACKSLASH_ESCAPES was not heeded in LOAD DATA INFILE and SELECT INTO OUTFILE. It is now.
* | Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0-btanozdrin/alik@quad.opbmk2008-03-281-14/+42
|\ \ | |/ | | | | into quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-bt-merged
| * Fix for Bug#35469: server crash with LOAD DATA INFILE to a VIEW.anozdrin/alik@quad.opbmk2008-03-281-14/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was that LOAD DATA code (sql_load.cc) didn't take into account that there may be items, representing references to other columns. This is a usual case in views. The crash happened because Item_direct_view_ref was casted to Item_user_var_as_out_param, which is not a base class. The fix is to 1) Handle references properly; 2) Ensure that an item is treated as a user variable only when it is a user variable indeed; 3) Report an error if LOAD DATA is used to load data into non-updatable column.
* | Merge magare.gmz:/home/kgeorge/mysql/autopush/B26461-5.0-optgkodinov/kgeorge@magare.gmz2008-03-211-1/+1
|\ \ | |/ | | | | into magare.gmz:/home/kgeorge/mysql/work/B26461-5.1-opt
| * Bug #26461: Intrinsic data type bool (1 byte) redefined to BOOL (4 bytes)gkodinov/kgeorge@macbook.gmz2008-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bool data type was redefined to BOOL (4 bytes on windows). Removed the #define and fixed some of the warnings that were uncovered by this. Note that the fix also disables 2 warnings : 4800 : 'type' : forcing value to bool 'true' or 'false' (performance warning) 4805: 'operation' : unsafe mix of type 'type' and type 'type' in operation These warnings will be handled in a separate bug, as they are performance related or bogus. Fixed to int the return type of functions that return more than 2 distinct values.
* | Rename send_ok to my_ok. Similarly to my_error, it only records the status,kostja@dipika.(none)2008-02-191-1/+1
| | | | | | | | does not send it to the client.
* | A fix and a test case for Bug#12713 "Error in a stored function called from kostja@dipika.(none)2008-02-191-10/+0
| | | | | | | | | | | | | | | | | | | | a SELECT doesn't cause ROLLBACK of statem". The idea of the fix is to ensure that we always commit the current statement at the end of dispatch_command(). In order to not issue redundant disc syncs, an optimization of the two-phase commit protocol is implemented to bypass the two phase commit if the transaction is read-only.
* | Manual merge 5.0-rpl -> 5.1-rpl.aelkin/elkin@koti.dsl.inet.fi2007-10-301-44/+5
| | | | | | | | involved bug#12691, bug#27571
* | Merge ↵aelkin/elkin@koti.dsl.inet.fi2007-10-301-3/+55
|\ \ | |/ | | | | | | | | koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug27571_asyn_killed_flags into koti.dsl.inet.fi:/home/elkin/MySQL/5.1-merge-bug27571
| * Bug #27571 asynchronousity in setting mysql_`query`::error andaelkin/elkin@koti.dsl.inet.fi2007-10-291-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Query_log_event::error_code A query can perform completely having the local var error of mysql_$query zero, where $query in insert, update, delete, load, and be binlogged with error_code e.g KILLED_QUERY while there is no reason do to so. That can happen because Query_log_event consults thd->killed flag to evaluate error_code. Fixed with implementing a scheme suggested and partly implemented at time of bug@22725 work-on. error_status is cached immediatly after the control leaves the main rows-loop and that instance always corresponds to `error' the local of mysql_$query functions. The cached value is passed to Query_log_event constructor, not the default thd->killed which can be changed in between of the caching and the constructing.
* | Merge dl145j.mysql.com:/tmp/andrei/mysql-5.0-rplaelkin@dl145j.mysql.com2007-09-151-1/+1
|\ \ | |/ | | | | into dl145j.mysql.com:/tmp/andrei/5.1-merge
| * Bug #23333 stored function + non-transac table + transac table = breaks ↵aelkin/elkin@dsl-hkibras-fe38f900-157.dhcp.inet.fi2007-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | stmt-based binlog Binlogging of the statement with a side effect like a modified non-trans table did not happen. The artifact involved all binloggable dml queries. Fixed with changing the binlogging conditions all over the code to exploit thd->transaction.stmt.modified_non_trans_table introduced by the patch for bug@27417. Multi-delete case has own specific addressed by another bug@29136. Multi-update case has been addressed by bug#27716 and patch and will need merging.
* | (Pushing for Andrei)gkodinov/kgeorge@magare.gmz2007-07-301-10/+6
|\ \ | |/ | | | | | | Merge magare.gmz:/home/kgeorge/mysql/work/B27417-5.0-opt into magare.gmz:/home/kgeorge/mysql/work/B27417-5.1-opt
| * (pushing for Andrei)gkodinov/kgeorge@magare.gmz2007-07-301-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack Once had been set the flag might later got reset inside of a stored routine execution stack. The reason was in that there was no check if a new statement started at time of resetting. The artifact affects most of binlogable DML queries. Notice, that multi-update is wrapped up within bug@27716 fix, multi-delete bug@29136. Fixed with saving parent's statement flag of whether the statement modified non-transactional table, and unioning (merging) the value with that was gained in mysql_execute_command. Resettling thd->no_trans_update members into thd->transaction.`member`; Asserting code; Effectively the following properties are held. 1. At the end of a substatement thd->transaction.stmt.modified_non_trans_table reflects the fact if such a table got modified by the substatement. That also respects THD::really_abort_on_warnin() requirements. 2. Eventually thd->transaction.stmt.modified_non_trans_table will be computed as the union of the values of all invoked sub-statements. That fixes this bug#27417; Computing of thd->transaction.all.modified_non_trans_table is refined to base to the stmt's value for all the case including insert .. select statement which before the patch had an extra issue bug@28960. Minor issues are covered with mysql_load, mysql_delete, and binloggin of insert in to temp_table select. The supplied test verifies limitely, mostly asserts. The ultimate testing is defered for bug@13270, bug@23333.
* | Merge magare.gmz:/home/kgeorge/mysql/work/mysql-5.0-optgkodinov/kgeorge@magare.gmz2007-07-041-0/+1
|\ \ | |/ | | | | into magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt
| * Merge gleb.loc:/home/uchum/work/bk/4.1-optgshchepa/uchum@gleb.loc2007-07-041-0/+1
| |\ | | | | | | | | | into gleb.loc:/home/uchum/work/bk/5.0-opt