Commit f6a36e94 authored by monty@donna.mysql.fi's avatar monty@donna.mysql.fi

Added LOAD DATA CONCURRENT

parent a580233a
......@@ -20510,7 +20510,8 @@ like you could do this, but that was a bug that has been corrected.
@section @code{LOAD DATA INFILE} Syntax
@example
LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE]
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name.txt'
[REPLACE | IGNORE]
INTO TABLE tbl_name
[FIELDS
[TERMINATED BY '\t']
......@@ -20538,6 +20539,12 @@ If you specify the keyword @code{LOW_PRIORITY}, execution of the
@code{LOAD DATA} statement is delayed until no other clients are reading
from the table.
If you specify the keyword @code{CONCURRENT} with a @code{MyISAM} table,
then other threads can retrieve data from the table while @code{LOAD
DATA} is executing. Using this option will of course affect the
performance of @code{LOAD DATA} a bit even if no other thread is using
the table at the same time.
Using @code{LOCAL} will be a bit slower than letting the server access the
files directly, because the contents of the file must travel from the client
host to the server host. On the other hand, you do not need the
......@@ -36784,6 +36791,17 @@ thread that is waiting on the disk-full condition will allow the other
threads to continue.
@end itemize
Exceptions to the above behaveour is when you use @code{REPAIR} or
@code{OPTIMIZE} or when the indexes are created in a batch after an
@code{LOAD DATA INFILE} or after an @code{ALTER TABLE} statement.
All of the above commands may use big temporary files that left to
themself would cause big problems for the rest of the system. If
@strong{MySQL} gets disk full while doing any of the above operations,
it will remove the big temporary files and mark the table as crashed
(except for @code{ALTER TABLE}, in which the old table will be left
unchanged).
@node Multiple sql commands, Temporary files, Full disk, Problems
@section How to Run SQL Commands from a Text File
......@@ -44096,6 +44114,8 @@ not yet 100% confident in this code.
@appendixsubsec Changes in release 3.23.38
@itemize @bullet
@item
Added option @code{CONCURRENT} to @code{LOAD DATA}.
@item
Fixed bug when too many rows where removed when using
@code{SELECT DISTINCT ... HAVING}.
@item
......@@ -30,7 +30,7 @@ mysqlhotcopy - fast on-line hot-backup utility for local MySQL databases and tab
mysqlhotcopy --method='scp -Bq -i /usr/home/foo/.ssh/identity' --user=root --password=secretpassword \
db_1./^nice_table/ user@some.system.dom:~/path/to/new_directory
WARNING: THIS IS VERY MUCH A FIRST-CUT ALPHA. Comments/patches welcome.
WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
=cut
......
......@@ -88,6 +88,7 @@ static SYMBOL symbols[] = {
{ "COMMIT", SYM(COMMIT_SYM),0,0},
{ "COMMITTED", SYM(COMMITTED_SYM),0,0},
{ "COMPRESSED", SYM(COMPRESSED_SYM),0,0},
{ "CONCURRENT", SYM(CONCURRENT),0,0},
{ "CONSTRAINT", SYM(CONSTRAINT),0,0},
{ "CREATE", SYM(CREATE),0,0},
{ "CROSS", SYM(CROSS),0,0},
......
......@@ -145,6 +145,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token COMMITTED_SYM
%token COLUMNS
%token COLUMN_SYM
%token CONCURRENT
%token CONSTRAINT
%token DATABASES
%token DATA_SYM
......@@ -2339,7 +2340,7 @@ use: USE_SYM ident
/* import, export of files */
load: LOAD DATA_SYM opt_low_priority opt_local INFILE TEXT_STRING
load: LOAD DATA_SYM load_data_lock opt_local INFILE TEXT_STRING
{
Lex->sql_command= SQLCOM_LOAD;
Lex->local_file= $4;
......@@ -2366,6 +2367,12 @@ opt_local:
/* empty */ { $$=0;}
| LOCAL_SYM { $$=1;}
load_data_lock:
/* empty */ { Lex->lock_option= current_thd->update_lock_default; }
| CONCURRENT { Lex->lock_option= TL_WRITE_CONCURRENT_INSERT ; }
| LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; }
opt_duplicate:
/* empty */ { Lex->duplicates=DUP_ERROR; }
| REPLACE { Lex->duplicates=DUP_REPLACE; }
......@@ -2523,6 +2530,7 @@ keyword:
| COMMIT_SYM {}
| COMMITTED_SYM {}
| COMPRESSED_SYM {}
| CONCURRENT {}
| DATA_SYM {}
| DATETIME {}
| DATE_SYM {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment