Commit 819a2992 authored by Alexander Nozdrin's avatar Alexander Nozdrin

Auto-merge from mysql-trunk.

parents 0e7c1044 e99e4536
...@@ -284,7 +284,7 @@ enum enum_commands { ...@@ -284,7 +284,7 @@ enum enum_commands {
Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR, Q_SEND_QUIT, Q_CHANGE_USER, Q_MKDIR, Q_RMDIR,
Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE, Q_LIST_FILES, Q_LIST_FILES_WRITE_FILE, Q_LIST_FILES_APPEND_FILE,
Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER, Q_SEND_SHUTDOWN, Q_SHUTDOWN_SERVER,
Q_MOVE_FILE, Q_MOVE_FILE, Q_SEND_EVAL,
Q_UNKNOWN, /* Unknown command. */ Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */ Q_COMMENT, /* Comments, ignored. */
...@@ -379,6 +379,7 @@ const char *command_names[]= ...@@ -379,6 +379,7 @@ const char *command_names[]=
"send_shutdown", "send_shutdown",
"shutdown_server", "shutdown_server",
"move_file", "move_file",
"send_eval",
0 0
}; };
...@@ -7056,7 +7057,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags) ...@@ -7056,7 +7057,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
/* /*
Evaluate query if this is an eval command Evaluate query if this is an eval command
*/ */
if (command->type == Q_EVAL) if (command->type == Q_EVAL || command->type == Q_SEND_EVAL)
{ {
init_dynamic_string(&eval_query, "", command->query_len+256, 1024); init_dynamic_string(&eval_query, "", command->query_len+256, 1024);
do_eval(&eval_query, command->query, command->end, FALSE); do_eval(&eval_query, command->query, command->end, FALSE);
...@@ -7880,6 +7881,7 @@ int main(int argc, char **argv) ...@@ -7880,6 +7881,7 @@ int main(int argc, char **argv)
break; break;
} }
case Q_SEND: case Q_SEND:
case Q_SEND_EVAL:
if (!*command->first_argument) if (!*command->first_argument)
{ {
/* /*
......
...@@ -58,11 +58,7 @@ select 1 as xml; ...@@ -58,11 +58,7 @@ select 1 as xml;
xml xml
1 1
create table t2(fl text); create table t2(fl text);
LOAD XML LOCAL INFILE "$MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" INTO TABLE t2 ROWS IDENTIFIED BY '<person>';; LOAD XML LOCAL INFILE "MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" INTO TABLE t2 ROWS IDENTIFIED BY '<person>';;
show processlist;
Id User Host db Command Time State Info
# root localhost test Query # NULL show processlist
# root localhost test Query # Reading from net LOAD XML LOCAL INFILE "$MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" INTO TABLE t2 ROWS IDENTIFIED BY '<p
drop table t1; drop table t1;
drop table t2; drop table t2;
create table t1 ( create table t1 (
......
...@@ -70,17 +70,18 @@ connection addconroot; ...@@ -70,17 +70,18 @@ connection addconroot;
create table t2(fl text); create table t2(fl text);
--let $PSEUDO_THREAD_ID=`select @@pseudo_thread_id ` --let $PSEUDO_THREAD_ID=`select @@pseudo_thread_id `
--send LOAD XML LOCAL INFILE "$MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" INTO TABLE t2 ROWS IDENTIFIED BY '<person>'; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--send_eval LOAD XML LOCAL INFILE "$MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" INTO TABLE t2 ROWS IDENTIFIED BY '<person>';
sleep 3; sleep 3;
connection default; connection default;
--replace_column 1 # 3 localhost 6 # sleep 1;
show processlist;
--disable_query_log --disable_query_log
--eval kill $PSEUDO_THREAD_ID --eval kill $PSEUDO_THREAD_ID
sleep 2;
--enable_query_log --enable_query_log
disconnect addconroot; disconnect addconroot;
......
...@@ -66,9 +66,12 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, ...@@ -66,9 +66,12 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos,
my_bool mi_dynmap_file(MI_INFO *info, my_off_t size) my_bool mi_dynmap_file(MI_INFO *info, my_off_t size)
{ {
DBUG_ENTER("mi_dynmap_file"); DBUG_ENTER("mi_dynmap_file");
if (size > (my_off_t) (~((size_t) 0))) if (size == 0 || size > (my_off_t) (~((size_t) 0)))
{ {
if (size)
DBUG_PRINT("warning", ("File is too large for mmap")); DBUG_PRINT("warning", ("File is too large for mmap"));
else
DBUG_PRINT("warning", ("Do not mmap zero-length"));
DBUG_RETURN(1); DBUG_RETURN(1);
} }
/* /*
......
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